April 2011
Intermediate to advanced
356 pages
8h 55m
English
The spy is on a covert operation. It intercepts the inputs destined for the production code, later providing it to the test case. As part of its covert mission, it may also feed return results to the client code, getting the CUT to do the test’s bidding. Very sneaky indeed.
After setting up the initial LightScheduler files (I use the shell scripts provided with CppUTest to create the initial files), write a test case that helps you envision the roles of the LightControllerSpy and FakeTimeService in the testing of LightScheduler. This tests helps you decide what facilities are needed in the test fixture.
| tests/HomeAutomation/LightSchedulerTest.cpp | |
| | TEST(LightScheduler, ScheduleOnEverydayNotTimeYet) |
| | { |
| | LightScheduler_ScheduleTurnOn(3, ... |