Example #1
0
    public void CoastKeepsInputsOn()
    {
        //arrange
        var enabled          = new PinStub(1);
        var clockwise        = new PinStub(2);
        var counterclockwise = new PinStub(3);
        var motor            = new Motor(enabled, clockwise, counterclockwise);

        motor.Start();

        //act
        motor.Coast();

        //assert
        Assert.Equal(PowerValue.Off, enabled.Power);
        Assert.Equal(PowerValue.On, clockwise.Power);
        Assert.Equal(PowerValue.Off, counterclockwise.Power);
    }