public HvacSystem GetNewSystemState(HvacSetPoint currentSetPoint, HvacSensors currentSensorValues) { if (currentSensorValues.IndoorTemp > currentSetPoint.MaxTemp) { return(HvacSystem.NormalCooling); } else { return(HvacSystem.Off); } }
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); } }
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); } }
public HvacSystem GetNewSystemState(HvacSetPoint currentSetPoint, HvacSensors currentSensorValues) { return(HvacSystem.Off); }