-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client: setters for JSON and XML Marshal/Unmarshal #621
Conversation
Codecov Report
@@ Coverage Diff @@
## master #621 +/- ##
==========================================
- Coverage 95.94% 95.91% -0.04%
==========================================
Files 10 10
Lines 1357 1395 +38
==========================================
+ Hits 1302 1338 +36
- Misses 34 35 +1
- Partials 21 22 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GRbit Thanks for your PR. Your PR description put a smile on my face, thanks.
Can you please add test cases for this PR? see here for more info
@jeevatkm I'm glad that it makes you smile. Sorry for taking your time on that, but could you please tell me what kind of tests should I do? The only test I can come up with is something like this:
But it looks silly for me to test such things because I don't think this test could possibly be helpful. If this is what you looking for – I'll be glad to add a test for each function. If not, please show me some examples in the code |
@GRbit Thanks for the getting back.
Just to be clear, why I mentioned about smile is regarding this part from the PR description. Because, time-to-time, I also do the same!
I understand, what you mean. However, based on the PR context, we are introducing a new setter methods for populating certain field. So it make sense to add a tiny test case which calls those setter(s) and does the assertion. |
@jeevatkm I respect your standards, so my only question was "how should I make those tests?". Please check out the code I've just added, I hope it's ok. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @GRbit for your contribution.
Today I learned that I can set external JSON library for resty to marshal JSON faster. It wasn't so obvious because I haven't read the docs (let's be honest it's not only me who doesn't read docs), but there was no method for
resty.Client
to override JSON marshal function.I suggest adding these
Set*
functions because this way they will be available through IDEs auto-completion.