| 1 | #include "unity.h" |
| 2 | #include "Types.h" |
| 3 | #include "TimerConductor.h" |
| 4 | #include "MockTimerHardware.h" |
| 5 | #include "MockTimerModel.h" |
| 6 | #include "MockTimerInterruptHandler.h" |
| 7 | |
| 8 | void setUp(void) |
| 9 | { |
| 10 | } |
| 11 | |
| 12 | void tearDown(void) |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | void testInitShouldCallHardwareInit(void) |
| 17 | { |
| 18 | TimerHardware_Init_Expect(); |
| 19 | |
| 20 | TimerConductor_Init(); |
| 21 | } |
| 22 | |
| 23 | void testRunShouldGetSystemTimeAndPassOnToModelForEventScheduling(void) |
| 24 | { |
| 25 | Timer_GetSystemTime_ExpectAndReturn(1230); |
| 26 | TimerModel_UpdateTime_Expect(1230); |
| 27 | TimerConductor_Run(); |
| 28 | |
| 29 | Timer_GetSystemTime_ExpectAndReturn(837460); |
| 30 | TimerModel_UpdateTime_Expect(837460); |
| 31 | TimerConductor_Run(); |
| 32 | } |