Ejemplo n.º 1
0
    public void Battery_display_after_driving_once()
    {
        var car = new RemoteControlCar();

        car.Drive();
        Assert.Equal("Battery at 99%", car.BatteryDisplay());
    }
Ejemplo n.º 2
0
    public void Battery_display_after_driving_multiple_times()
    {
        var car = new RemoteControlCar();

        for (var i = 0; i < 23; i++)
        {
            car.Drive();
        }

        Assert.Equal("Battery at 77%", car.BatteryDisplay());
    }
Ejemplo n.º 3
0
    public void Battery_display_when_battery_empty()
    {
        var car = new RemoteControlCar();

        // Drain the battery
        for (var i = 0; i < 100; i++)
        {
            car.Drive();
        }

        // Attempt to drive one more time (should not work)
        car.Drive();

        Assert.Equal("Battery empty", car.BatteryDisplay());
    }
Ejemplo n.º 4
0
    public void New_car_battery_display()
    {
        var car = new RemoteControlCar();

        Assert.Equal("Battery at 100%", car.BatteryDisplay());
    }