public async Task SetToCoolingMode_AirConditionerIsOff_AirConditionerSwitchesToStandBy() { // Arrange. IAirConditioner airConditioner = new FakeAirConditioner(LoggerFactory.CreateLogger <IAirConditioner>(), 10, secondsToTemperatureChange: 0); airConditioner.PowerOff(); // Act. await airConditioner.StartCoolingMode(5); // Assert airConditioner.RoomTemperature.Should().Be(10); airConditioner.CurrentMode.Should().Be(AirConditionerMode.StandBy); }
public async Task StartCoolingMode_TargetTemperatureLowerThanMix_AirConditionerCoolsRoomToMin() { // Arrange. IAirConditioner airConditioner = new FakeAirConditioner(LoggerFactory.CreateLogger <IAirConditioner>(), 5 + 1, secondsToTemperatureChange: 0); airConditioner.PowerOn(); // Act. await airConditioner.StartCoolingMode(airConditioner.MinTemperature - 1); // Assert await Task.Delay(TimeSpan.FromSeconds(1)); airConditioner.RoomTemperature.Should().Be(airConditioner.MinTemperature); airConditioner.CurrentMode.Should().Be(AirConditionerMode.StandBy); }
public async Task SetToCoolingMode_RoomTemperatureIsHigherThanTarget_AirConditionerCoolsRoom() { // Arrange. IAirConditioner airConditioner = new FakeAirConditioner(LoggerFactory.CreateLogger <IAirConditioner>(), 10, secondsToTemperatureChange: 0); airConditioner.PowerOn(); // Act. await airConditioner.StartCoolingMode(9); // Assert await Task.Delay(TimeSpan.FromSeconds(1)); airConditioner.RoomTemperature.Should().Be(9); airConditioner.CurrentMode.Should().Be(AirConditionerMode.StandBy); }