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 NerfUS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ServomotorTest.cpp Source File

ServomotorTest.cpp

00001 #include "gmock/gmock.h"
00002 #include "gtest/gtest.h"
00003 
00004 #include "Servomotor.hpp"
00005 #include "mocks/MockPwmOut.hpp"
00006 
00007 TEST(ServomotorTest, SetPositionDown)
00008 {
00009     MockPwmOut mock_pwm_out;
00010     Servomotor servomotor(mock_pwm_out);
00011 
00012     EXPECT_CALL(mock_pwm_out, pulsewidth_us(500))
00013         .Times(1);
00014 
00015     servomotor.set_position_down();
00016 }
00017 
00018 TEST(ServomotorTest, SetPositionUp)
00019 {
00020     MockPwmOut mock_pwm_out;
00021     Servomotor servomotor(mock_pwm_out);
00022 
00023     EXPECT_CALL(mock_pwm_out, pulsewidth_us(1500))
00024         .Times(1);
00025 
00026     servomotor.set_position_up();
00027 }
00028