Exemplo n.º 1
0
        public void StartVehicle_NonDieselCar_ShouldStartVehicle()
        {
            // Arrange
            var car = new Car
                          {
                              FuelType = FuelType.Hybrid,
                              EngineState = EngineState.Stopped,
                              MessageLog = new List<string>()
                          };

            // Act
            car.StartVehicle(car);

            // Assert
            car.EngineState.Should().Be(EngineState.Started);
            car.MessageLog.Count.Should().Be(1);
        }
Exemplo n.º 2
0
        public void StartVehicle_DieselCar_ShouldStartVehicleAndWarmGlowPlugs()
        {
            // Arrange
            var car = new Car
            {
                FuelType = FuelType.Diesel,
                EngineState = EngineState.Stopped,
                MessageLog = new List<string>(),
                Make = "BMW"
            };

            // Act
            car.StartVehicle(car);

            // Assert
            car.EngineState.Should().Be(EngineState.Started);
            car.MessageLog.Count.Should().Be(2);
            car.MessageLog.Should().Contain(m => m == "Warming glow-plugs.");
        }