Esempio n. 1
0
 public HvacSystem GetNewSystemState(HvacSetPoint currentSetPoint, HvacSensors currentSensorValues)
 {
     if (currentSensorValues.IndoorTemp > currentSetPoint.MaxTemp)
     {
         return(HvacSystem.NormalCooling);
     }
     else
     {
         return(HvacSystem.Off);
     }
 }
Esempio n. 2
0
        public void GetNewSystemStateTest(double maxTemp, double minTemp, double indoorTemp, double outdoorTemp, bool cooling)
        {
            var alg = new CoolOnly();

            var setPoint = new HvacSetPoint(maxTemp, minTemp);

            HvacSensors sensors = new HvacSensors(indoorTemp, outdoorTemp);

            var newSystemState = alg.GetNewSystemState(setPoint, sensors);

            if (cooling)
            {
                Assert.AreEqual(HvacSystem.NormalCooling, newSystemState);
            }
            else
            {
                Assert.AreEqual(HvacSystem.Off, newSystemState);
            }
        }
Esempio n. 3
0
        public void GetNewSystemState(double indoorTemp, double outdoorTemp, double maxTemp, double minTemp, bool cool, bool heat)
        {
            var alg = new AutoHeatCool();

            var setPoint = new HvacSetPoint(maxTemp, minTemp);

            HvacSensors sensors = new HvacSensors(indoorTemp: indoorTemp, outdoorTemp: outdoorTemp);

            var newSystemState = alg.GetNewSystemState(setPoint, sensors);

            if (cool)
            {
                Assert.AreEqual(HvacSystem.NormalCooling, newSystemState);
            }
            else if (heat)
            {
                Assert.AreEqual(HvacSystem.NormalHeating, newSystemState);
            }
            else
            {
                Assert.AreEqual(HvacSystem.Off, newSystemState);
            }
        }
Esempio n. 4
0
 public HvacSystem GetNewSystemState(HvacSetPoint currentSetPoint, HvacSensors currentSensorValues)
 {
     return(HvacSystem.Off);
 }