Esempio n. 1
0
        public void Refuel_ShouldAddToCurrentFuelAmountProvidedFuelAmount_CurrentValue()
        {
            var car = new Car.Car(Color.Black, "Ford", 5.7f, 40);

            car.Refuel(14.0f);

            car.FuelLevel.Should().Be(14);
        }
Esempio n. 2
0
        public void Drive_ShouldIncreaseOdometerAndCalculateFuelNeededToDrive_ExceptionIfFuelIsNotEnought()
        {
            var car = new Car.Car(Color.Black, "Ford", 5.7f, 40);

            car.Refuel(14.0f);
            car.Drive(100);

            car.Odometer.Should().Be(100);
        }
Esempio n. 3
0
        public void Drive_ShouldResetDailyOdometer_Zero()
        {
            var car = new Car.Car(Color.Black, "Ford", 5.7f, 40);

            car.Refuel(10);
            car.Drive(10);
            car.Drive(20);
            car.ResetDailyOdometer();

            car.DailyOdometer.Should().Be(0);
        }