NerfUS / Mbed 2 deprecated NerfUSTarget

Dependencies:   LedController mbed-rtos mbed NerfUSXbee Servomotor TargetManager

Fork of NerfUS by NerfUS

TESTS/ServomotorTest.cpp

Committer:
Maxime Dupuis
Date:
2017-02-26
Revision:
16:fba7c8e39388
Child:
27:3ae7c62008ea

File content as of revision 16:fba7c8e39388:

#include "gmock/gmock.h"
#include "gtest/gtest.h"

#include "Servomotor.hpp"
#include "MockPwmOut.hpp"

TEST(ServomotorTest, SetPositionDown)
{
    MockPwmOut mock_pwm_out;
    Servomotor servomotor(mock_pwm_out);

    EXPECT_CALL(mock_pwm_out, pulsewidth_ms(1))
        .Times(1);

    servomotor.set_position_down();
}

TEST(ServomotorTest, SetPositionUp)
{
    MockPwmOut mock_pwm_out;
    Servomotor servomotor(mock_pwm_out);

    EXPECT_CALL(mock_pwm_out, pulsewidth_ms(1.5))
        .Times(1);

    servomotor.set_position_up();
}