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); }
public void StopVehicle_UsingJetFuel_ShouldRunEngineCoolingProcess() { // Arrange var car = new Car { EngineState = EngineState.Started, FuelType = FuelType.JetFuel, RadioState = RadioState.Off, MessageLog = new List<string>() }; // Act car.StopVehicle(car); // Assert car.EngineState.Should().Be(EngineState.Stopped); car.MessageLog.Should().Contain("Cooling engine."); }
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."); }
public void StopVehicle_WithRadioSateFM_ShouldSetRadioStateToOff() { // Arrange var car = new Car { EngineState = EngineState.Started, FuelType = FuelType.Hybrid, RadioState = RadioState.FM, MessageLog = new List<string>() }; // Act car.StopVehicle(car); // Assert car.EngineState.Should().Be(EngineState.Stopped); car.RadioState.Should().Be(RadioState.Off); }
public void StopVehicle_WithStartedEngine_ShouldStopVehicle() { // Arrange var car = new Car { EngineState = EngineState.Started, FuelType = FuelType.Electirc, RadioState = RadioState.Off, MessageLog = new List<string>() }; // Act car.StopVehicle(car); // Assert car.EngineState.Should().Be(EngineState.Stopped); }