NerfUS game coordinator for the Nerf gun firing range
Dependencies: HardwareInterface mbed-rtos mbed
Fork of NerfUS by
TESTS/HardwareInterfaceImportTest.cpp@17:48474266a361, 2017-03-17 (annotated)
- Committer:
- Ismael Balafrej
- Date:
- Fri Mar 17 17:19:42 2017 -0400
- Branch:
- PlayableGame
- Revision:
- 17:48474266a361
- Parent:
- 13:850be84c78dd
First Commit of PlayableGame
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Maxime Dupuis |
13:850be84c78dd | 1 | #include "gmock/gmock.h" |
Maxime Dupuis |
13:850be84c78dd | 2 | #include "gtest/gtest.h" |
Maxime Dupuis |
13:850be84c78dd | 3 | #include "HardwareInterface.hpp" |
Maxime Dupuis |
13:850be84c78dd | 4 | |
Maxime Dupuis |
13:850be84c78dd | 5 | class MockHardwareLPC1768 : public HardwareInterface |
Maxime Dupuis |
13:850be84c78dd | 6 | { |
Maxime Dupuis |
13:850be84c78dd | 7 | public: |
Maxime Dupuis |
13:850be84c78dd | 8 | MOCK_METHOD0(blink, void()); |
Maxime Dupuis |
13:850be84c78dd | 9 | }; |
Maxime Dupuis |
13:850be84c78dd | 10 | |
Maxime Dupuis |
13:850be84c78dd | 11 | TEST(ImportingLibraryFromMbedOrg, IsPossibleToMockInterface) |
Maxime Dupuis |
13:850be84c78dd | 12 | { |
Maxime Dupuis |
13:850be84c78dd | 13 | MockHardwareLPC1768 hardwareLPC1768; |
Maxime Dupuis |
13:850be84c78dd | 14 | |
Maxime Dupuis |
13:850be84c78dd | 15 | EXPECT_CALL(hardwareLPC1768, blink()); |
Maxime Dupuis |
13:850be84c78dd | 16 | |
Maxime Dupuis |
13:850be84c78dd | 17 | hardwareLPC1768.blink(); |
Maxime Dupuis |
13:850be84c78dd | 18 | } |
Maxime Dupuis |
13:850be84c78dd | 19 |