NerfUS mobile node that manages a target for the Nerf gun firing range
Dependencies: LedController mbed-rtos mbed NerfUSXbee Servomotor TargetManager
Fork of NerfUS by
TESTS/TargetManagerTest.cpp@30:412a779cf607, 2017-03-27 (annotated)
- Committer:
- Maxime Dupuis
- Date:
- Mon Mar 27 19:05:45 2017 -0400
- Revision:
- 30:412a779cf607
- Parent:
- 28:8fc53a870691
- Child:
- 31:c6dc9811ed14
Finish TargetManager constructor
Takes a list of managed targets and a NerfusTicker
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Maxime Dupuis |
28:8fc53a870691 | 1 | #include "gmock/gmock.h" |
Maxime Dupuis |
28:8fc53a870691 | 2 | #include "gtest/gtest.h" |
Maxime Dupuis |
28:8fc53a870691 | 3 | |
Maxime Dupuis |
30:412a779cf607 | 4 | #include "mocks/MockNerfusTicker.hpp" |
Maxime Dupuis |
28:8fc53a870691 | 5 | #include "mocks/MockTarget.hpp" |
Maxime Dupuis |
28:8fc53a870691 | 6 | #include "TargetManager.hpp" |
Maxime Dupuis |
28:8fc53a870691 | 7 | |
Maxime Dupuis |
28:8fc53a870691 | 8 | class TargetManagerTest : public ::testing::Test |
Maxime Dupuis |
28:8fc53a870691 | 9 | { |
Maxime Dupuis |
28:8fc53a870691 | 10 | public: |
Maxime Dupuis |
28:8fc53a870691 | 11 | TargetManagerTest() |
Maxime Dupuis |
28:8fc53a870691 | 12 | { |
Maxime Dupuis |
30:412a779cf607 | 13 | targets.push_back(&mock_target_a); |
Maxime Dupuis |
30:412a779cf607 | 14 | targets.push_back(&mock_target_b); |
Maxime Dupuis |
28:8fc53a870691 | 15 | } |
Maxime Dupuis |
28:8fc53a870691 | 16 | |
Maxime Dupuis |
30:412a779cf607 | 17 | MockTarget mock_target_a; |
Maxime Dupuis |
30:412a779cf607 | 18 | MockTarget mock_target_b; |
Maxime Dupuis |
30:412a779cf607 | 19 | std::vector<TargetInterface*> targets; |
Maxime Dupuis |
30:412a779cf607 | 20 | |
Maxime Dupuis |
30:412a779cf607 | 21 | MockNerfusTicker mock_nerfus_ticker; |
Maxime Dupuis |
28:8fc53a870691 | 22 | }; |
Maxime Dupuis |
28:8fc53a870691 | 23 | |
Maxime Dupuis |
28:8fc53a870691 | 24 | TEST_F(TargetManagerTest, LibraryBuilds) |
Maxime Dupuis |
28:8fc53a870691 | 25 | { |
Maxime Dupuis |
30:412a779cf607 | 26 | TargetManager target_manager(targets, mock_nerfus_ticker); |
Maxime Dupuis |
28:8fc53a870691 | 27 | } |
Maxime Dupuis |
28:8fc53a870691 | 28 |