Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }