예제 #1
0
        public void HeaterTurnOffTestWritesToConsoleCorrect(string expected)
        {
            using var consoleOutput = new ConsoleOutput();

            _heater.TurnOff();
            Assert.AreEqual(expected, consoleOutput.GetOuput());
        }
예제 #2
0
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < _threshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }

            if (t > _maxTemp)
            {
                _window.Open();
            }
            else
            {
                _window.Close();
            }

            if (_window.IsOpen())
            {
                _heater.TurnOff();
            }
        }
예제 #3
0
 public void ChangeState(IDoor door, ILight light, IHeater heater, IStartButton startButton, ITimer timer)
 {
     door.OpenDoor();
     light.TurnOnLight();
     heater.TurnOff();
     startButton.ButtonIsNotPressed();
     timer.Stop();
 }
예제 #4
0
        public void TurnOff(int værdi)
        {
            heater.logger = fake;
            heater.TurnOff();
            int resultat = fake.value;

            Assert.That(resultat, Is.EqualTo(værdi));
        }
예제 #5
0
 public void TurnOff_TurnOff_HeaterHasBeenTurnedOff()
 {
     //Arrange
     //Act
     _heater.TurnOff();
     //Assert
     Assert.AreEqual(_fakeConsole.ConsoleLine, "Heater is off");
 }
예제 #6
0
 public void Regulate()
 {
     // Determine which action to take according to the temperature
     if (CurrentTemperature < LowerTemperatureThreshold)
     {
         _heater.TurnOn();
         _window.Close();
     }
     else if (CurrentTemperature >= LowerTemperatureThreshold && CurrentTemperature <= UpperTemperatureThreshold)
     {
         _heater.TurnOff();
         _window.Close();
     }
     else
     {
         _heater.TurnOff();
         _window.Open();
     }
 }
예제 #7
0
        public void HeaterOffNTimes(int n)
        {
            heat = new FakeHeater();
            for (int i = 0; i < n; i++)
            {
                heat.TurnOff();
            }

            Assert.That(heat.TurnOffCalledTimes, Is.EqualTo(n));
        }
예제 #8
0
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < _thresholdLower)
            {
                _heater.TurnOn();
                _window.Close();
            }
            else if (t > _thresholdUpper)
            {
                _heater.TurnOff();
                _window.Open();
            }
            else
            {
                _heater.TurnOff();
                _window.Close();
            }
        }
예제 #9
0
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < _threshold && t < _upperthreshold)
            {
                _heater.TurnOn();
                _window.CloseWindow();
            }
            else if (t > _threshold && t > _upperthreshold)
            {
                _heater.TurnOff();
                _window.OpenWindow();
            }
            else if (t > _threshold && t < _upperthreshold)
            {
                _heater.TurnOff();
                _window.CloseWindow();
            }
        }
예제 #10
0
 private void Regulate()
 {
     if (CurrentTemperature < _threshold)
     {
         _heater.TurnOn();
     }
     else
     {
         _heater.TurnOff();
     }
 }
예제 #11
0
        public void Regulate()
        {
            var t = GetCurTemp();

            if (t < _threshold)
            {
                _heater.TurnOn();
                _window.Close();
            }
            else if (t > _threshold)
            {
                _heater.TurnOff();
                _window.Open();
            }
            else
            {
                _heater.TurnOff();
                _window.Close();
            }
        }
 private void AdjustHeater(int temp)
 {
     if (temp < _heaterThreshold)
     {
         _heater.TurnOn();
     }
     else
     {
         _heater.TurnOff();
     }
 }
예제 #13
0
파일: ECS.cs 프로젝트: TeamSWT34/Grup34_ECS
 public void Regulate()
 {
     if (GetCurTemp() < GetThreshold())
     {
         _heater.TurnOn();
     }
     else
     {
         _heater.TurnOff();
     }
 }
예제 #14
0
        //public void Regulate()
        //{
        //    var t = _tempSensor.GetTemp();
        //    if (t < _threshold)
        //        _heater.TurnOn();
        //    else
        //        _heater.TurnOff();

        //}
        public void Regulate()
        {
            Console.WriteLine("Im in regulate");
            if (CurrentTemperature < _threshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }
        }
예제 #15
0
        public void Regulate()
        {
            var curTemp = _tempSensor.GetTemp();

            // Determine which action to take according to the temperature
            if (curTemp < LowerTemperatureThreshold)
            {
                _heater.TurnOn();
                _window.Close();
            }
            else if (curTemp >= LowerTemperatureThreshold && curTemp <= UpperTemperatureThreshold)
            {
                _heater.TurnOff();
                _window.Close();
            }
            else
            {
                _heater.TurnOff();
                _window.Open();
            }
        }
        public void Regulate()
        {
            var t = _temp.getTemp();

            // Determine which action to take according to the temperature
            if (t < LowerTemperatureThreshold)
            {
                _heater.TurnOn();
                _window.Close();
            }
            else if (t >= LowerTemperatureThreshold && t <= UpperTemperatureThreshold)
            {
                _heater.TurnOff();
                _window.Close();
            }
            else
            {
                _heater.TurnOff();
                _window.Open();
            }
        }
예제 #17
0
        public void Regulate()
        {
            int temperature = _temperatureSensor.GetTemperature();

            if (temperature < Threshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }
        }
예제 #18
0
파일: ECS.cs 프로젝트: florent417/ECS
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < _threshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }
        }
예제 #19
0
        public void Regulate()
        {
            var curTemp = _tempSensor.GetTemp();

            if (curTemp < TemperatureThreshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }
        }
예제 #20
0
            public void Regulate()
            {
                var currentTemperature = _tempSensor.GetTemp();

                //Determining what action the heater should take
                if (currentTemperature < 20)
                {
                    _heater.TurnOn();
                }
                else if (currentTemperature >= 25)
                {
                    _heater.TurnOff();
                }
            }
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < _thresholdHeater && !_window.WindowOpen)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }

            if (t > _thresholdWindow)
            {
                _heater.TurnOff();
                _window.Open();
            }
            else
            {
                _window.Close();
            }
        }
예제 #22
0
        public void Regulate()
        {
            _currentTemp = _tempSensor.GetTemp();
            if (_currentTemp < _threshold)
            {
                _heater.TurnOn();
                _window.Open();
            }

            if (_currentTemp > _threshold)
            {
                _heater.TurnOff();
                _window.Close();
            }
        }
예제 #23
0
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < Threshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }

            _window.WindowCtrl(GetCurTemp());
        }
예제 #24
0
        private bool RegulateHeater()
        {
            var t = _tempSensor.GetTemp();

            if (t < _heaterTempThreshold)
            {
                _heater.TurnOn();
                return(true);
            }
            else
            {
                _heater.TurnOff();
                return(false);
            }
        }
예제 #25
0
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < 0)
            {
                throw new ArgumentException("Det kan ikke passe");
            }
            if (t < _threshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }
        }
        public void Regulate()
        {
            var currentTemperature = _tempSensor.GetTemp();

            //Determining what action the heater should take
            if (currentTemperature < 20)
            {
                _heater.TurnOn();
            }
            else if (currentTemperature >= 25)
            {
                _heater.TurnOff();
            }

            //This below part was unable to being tested according to Jenkins Coverage

            //else
            //{
            //    _heater.TurnOff();
            //}
        }
예제 #27
0
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < _threshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }

            if (t > _WindowThreshold)
            {
                _Window.open();  //Window extension
            }
            else
            {
                _Window.close(); //Window extension
            }
        }
예제 #28
0
        public void Regulate()
        {
            var t = _tempSensor.GetTemp();

            if (t < _minThreshold)
            {
                _heater.TurnOn();
            }
            else
            {
                _heater.TurnOff();
            }

            if (t >= MaxThreshold)
            {
                WindowOpen = true;
                Console.WriteLine("Window opened");
            }
            else
            {
                WindowOpen = false;
                Console.WriteLine("Window closed");
            }
        }
예제 #29
0
 public void Regulate_HighTemp_HeaterTurnOff_WindowOpen()
 {
     _tempSensor.GetTemp().Returns(30);
     _uut.Regulate();
     _heater.TurnOff();
 }
예제 #30
0
 public void TurnOff_CallMethodTurnOff_ResultIsTrue()
 {
     uut.TurnOff();
     Assert.That(fakeLogger.PrintBool, Is.True);
 }