public void CanUpdateSetPointTemperature() { thermostat.UpdatedSetPointTemperature = Temperature.FromDegreesCelcius(21.5F); var parsedThermostat = new ParsedThermostat(thermostat); parsedThermostat.ApplyUpdates(); Assert.AreEqual(21.5, new ParsedThermostat(thermostat).SetPointTemperature.InDegreesCelcius); }
public void CanRemoveVacationDates() { thermostat.UpdateVacation(DateTime.Now, DateTime.Now); new ParsedThermostat(thermostat).ApplyUpdates(); thermostat.CancelVacation(); new ParsedThermostat(thermostat).ApplyUpdates(); var parsedThermostat = new ParsedThermostat(thermostat); Assert.IsNull(parsedThermostat.VacationFrom); Assert.IsNull(parsedThermostat.VacationTo); }
public void CanUpdateVacationDates() { var from = DateTime.Parse("2019-02-13 13:30:00 +0100"); var to = DateTime.Parse("2019-02-20 18:15:00 +0100"); thermostat.UpdateVacation(from, to); new ParsedThermostat(thermostat).ApplyUpdates(); var parsedThermostat = new ParsedThermostat(thermostat); Assert.AreEqual(from, parsedThermostat.VacationFrom); Assert.AreEqual(to, parsedThermostat.VacationTo); }