![]() | How to add tests for moved function |
|
03 Aug 2012, 16:22
Dennis Lambe (6 posts) |
In chapter 12 you factor out the function Time_MatchesDaysOfWeek() into Time.c, using the existing tests as a safety net. You then say “for the long-term the new functions need their own tests.” Can you go into some detail about the best way to add those tests? If they’re added in the usual way, they’ll pass immediately and you’ll never have the opportunity to test the tests. |
|
05 Sep 2012, 16:35
James Grenning (130 posts) |
The added tests would pass immediately. You might feel in some cases that injecting an error temporarily into the production code is a good idea. In the case of |
| You must be logged in to comment |

