Unit testing code paths
Posted
by
Michael
on Programmers
See other posts from Programmers
or by Michael
Published on 2011-02-03T19:37:05Z
Indexed on
2011/02/03
23:34 UTC
Read the original article
Hit count: 477
When unit testing using expectations, you define a set of method calls and corresponding results for those calls. These define the path through the method that you want to test.
I have read that unit tests should not duplicate the code. But when you define these expectations, isn't that duplicating the code, or at least the process? How do you know when you're duplicating functionality under test?
© Programmers or respective owner