ClassicUPS icon indicating copy to clipboard operation
ClassicUPS copied to clipboard

Tests for UPS

Open shalakhin opened this issue 10 years ago • 1 comments

It would be great to have this package covered with tests.

shalakhin avatar Nov 28 '14 13:11 shalakhin

Totally! How would one do it?

I'm personally not a fan of mocking in this case, because the entire point of this library is to wrap around their API, and without real results (which may change over time) then our mocks aren't very helpful. Same for testing things like network connectivity, etc.

The other hard thing is acceptance criteria. You could say "I expect a shipping label to be returned", but nothing in the return json would indicate whether, for example, "return service" was requested or how things are billed. Then again, maybe that is not important to test.

What do you think is important, and what's the most effective way to test it?

poundifdef avatar Nov 29 '14 22:11 poundifdef