public void GetCurTemp_GetCurTempIsCalled_Returns15()
        {
            var fakeHeater     = new FakeHeater();
            var fakeWindow     = new FakeWindow();
            var fakeTempSensor = new FakeTempSensor();

            fakeTempSensor.Temp = 15;
            var uut = new NewDesign.ECS(0, 0, fakeTempSensor, fakeHeater, fakeWindow);

            Assert.That(uut.GetCurTemp() == 15);
        }
        public void Regulate_TempIsEqualToThr_HeaterTurnsOff()
        {
            var fakeHeater     = new FakeHeater();
            var fakeWindow     = new FakeWindow();
            var fakeTempSensor = new FakeTempSensor();
            var uut            = new NewDesign.ECS(0, 0, fakeTempSensor, fakeHeater, fakeWindow);

            fakeTempSensor.Temp = 25;
            uut.SetHeaterThreshold(25);
            uut.Regulate();
            Assert.That(fakeHeater.TurnOffHasBeenCalled == true);
        }
        public void SetWindowThreshold_SetterCalled_WindowThrIsAlwaysEqualToOrGreaterThanHeatThr(int winThr, int heatThr)
        {
            var fakeHeater     = new FakeHeater();
            var fakeWindow     = new FakeWindow();
            var fakeTempSensor = new FakeTempSensor();
            var uut            = new NewDesign.ECS(0, 0, fakeTempSensor, fakeHeater, fakeWindow);

            uut.SetHeaterThreshold(heatThr);
            uut.SetWindowThreshold(winThr);

            Assert.That(uut.GetHeaterThreshold() <= uut.GetWindowThreshold());
        }
        public void Regulate_TempIsHigherThanThr_WindowOpens()
        {
            var fakeHeater     = new FakeHeater();
            var fakeWindow     = new FakeWindow();
            var fakeTempSensor = new FakeTempSensor();
            var uut            = new NewDesign.ECS(0, 0, fakeTempSensor, fakeHeater, fakeWindow);

            fakeTempSensor.Temp = 30;
            uut.SetWindowThreshold(25);
            uut.Regulate();
            Assert.That(fakeWindow.WindowIsOpen == true);
        }
        public void Regulate_TempIsEqualToThr_WindowCloses()
        {
            var fakeHeater     = new FakeHeater();
            var fakeWindow     = new FakeWindow();
            var fakeTempSensor = new FakeTempSensor();
            var uut            = new NewDesign.ECS(0, 0, fakeTempSensor, fakeHeater, fakeWindow);

            fakeTempSensor.Temp = 25;
            uut.SetWindowThreshold(25);
            uut.Regulate();
            Assert.That(fakeWindow.WindowIsClosed == true);
        }
        public void Ctor_ConstructorIsCalled_WindowThresholdIsLargerOrEqualToHeaterThreshold(int winThr, int heatThr)
        {
            var ctorUut = new NewDesign.ECS(heatThr, winThr, null, null, null);

            Assert.That(ctorUut.GetHeaterThreshold() <= ctorUut.GetWindowThreshold());
        }