public void CancelVacation(Thermostat thermostat) { if (attributeValues.Length != 0) { Console.Error.WriteLine($"Expected no further arguments for cancel vacation, got {attributeValues.Length}"); Environment.Exit(1); } thermostat.CancelVacation(); }
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); }