loading...

re: Unit testing is simple VIEW POST

TOP OF THREAD FULL DISCUSSION
re: This is a good starting point! I'm not an expert on this topic, but unit testing seems easy when you test "pure" functions. What happens when you h...
 

What happens when you have different results for the same input?

You implement it as a proper state machine and test each state independently. The vending machine Kata is a great example of just that. Man, that one drove me up the wall. I'd much prefer to just have functions that always return the same output given the same input.

github.com/rubberduck203/VendingMa...

code of conduct - report abuse