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
Diff: TESTS/TargetManagerTest.cpp
- Revision:
- 34:85994e0501fb
- Parent:
- 32:50b777bab5a4
- Child:
- 35:7ee45f6d6484
diff -r 860ed7757673 -r 85994e0501fb TESTS/TargetManagerTest.cpp --- a/TESTS/TargetManagerTest.cpp Thu Mar 30 14:11:35 2017 -0400 +++ b/TESTS/TargetManagerTest.cpp Thu Mar 30 14:38:38 2017 -0400 @@ -40,9 +40,7 @@ EXPECT_CALL(mock_nerfus_ticker, start(1000)); TargetManager target_manager(targets, mock_nerfus_ticker); - std::vector<TargetInfo> sequence; - sequence.push_back(make_TargetInfo(0, TARGET_TYPE_ALLY, 1000)); - target_manager.execute(sequence); + target_manager.execute(make_TargetInfo(0, TARGET_TYPE_ALLY, 1000)); } TEST_F(TargetManagerTest, WhenExecutingEnemyTargetThenUseTheCorrectTargetTypeAndTimeout) @@ -51,9 +49,7 @@ EXPECT_CALL(mock_nerfus_ticker, start(2000)); TargetManager target_manager(targets, mock_nerfus_ticker); - std::vector<TargetInfo> sequence; - sequence.push_back(make_TargetInfo(1, TARGET_TYPE_ENEMY, 2000)); - target_manager.execute(sequence); + target_manager.execute(make_TargetInfo(1, TARGET_TYPE_ENEMY, 2000)); } TEST_F(TargetManagerTest, WhenActiveTargetIsHitThenSendTheEvent) @@ -66,9 +62,7 @@ EXPECT_CALL(mock_target_a, hit(42)); TargetManager target_manager(targets, mock_nerfus_ticker); - std::vector<TargetInfo> sequence; - sequence.push_back(make_TargetInfo(0, TARGET_TYPE_ALLY, 1000)); - target_manager.execute(sequence); + target_manager.execute(make_TargetInfo(0, TARGET_TYPE_ALLY, 1000)); target_manager.target_hit(0); } @@ -83,9 +77,7 @@ EXPECT_CALL(mock_target_a, timeout(42)); TargetManager target_manager(targets, mock_nerfus_ticker); - std::vector<TargetInfo> sequence; - sequence.push_back(make_TargetInfo(0, TARGET_TYPE_ALLY, 1000)); - target_manager.execute(sequence); + target_manager.execute(make_TargetInfo(0, TARGET_TYPE_ALLY, 1000)); target_manager.target_missed(0); }