Ejemplo n.º 1
0
 public void Regulate_TempBelowThreshold_HeaterTurnedOn(int curTemp, int thres, int reg)
 {
     _fakeTempSensor.GetTemp().Returns(curTemp);
     _uut.SetThreshold(thres);
     _uut.Regulate();
     _fakeHeater.Received(reg).TurnOn();
 }
Ejemplo n.º 2
0
 public void SetAndGetThreshold_ChangeThreshold_ThresholdChanged(int threshold)
 {
     //Arrange
     //Act
     _ecsSystem.SetThreshold(threshold);
     //Assert
     Assert.AreEqual(_ecsSystem.GetThreshold(), threshold);
 }
        public void SetThreshold_initiateWithXChangeToY_ThresholdIsY(int Y)
        {
            //Arrange
            //Act
            uut.SetThreshold(Y);

            //Act
            Assert.That(uut.GetThreshold(), Is.EqualTo(Y));
        }
        public void Regulate_TemperatureOverThreshold_ECSTurnOffHeater(int temp, int threshold)
        {
            //Arrange
            _tempSensor.GetTemp().Returns(temp);
            _ecsSystem.SetThreshold(threshold);

            //Act
            _ecsSystem.Regulate();
            //Assert
            _heater.Received(1).TurnOff();
        }
Ejemplo n.º 5
0
        public void SetThreshold_ThresholdIsSetCorrect()
        {
            // Act
            _uut.SetThreshold(20);

            Assert.That(_uut.GetThreshold(), Is.EqualTo(20));
        }
        public void SetThreshold_initiateWithXChangeToY_ThresholdIsY(int X, int Y)
        {
            uut = new ECS(new dummyTemoSensor(), new dummyHeater(), X);
            uut.SetThreshold(Y);

            Assert.That(uut.GetThreshold(), Is.EqualTo(Y));
        }
Ejemplo n.º 7
0
        public void SetThreshold_Test(int thr)
        {
            var uut = new ECS(35, new TestTempSensor(), new TestHeater());

            uut.SetThreshold(thr);
            Assert.That(uut.GetThreshold(), Is.EqualTo(thr));
        }
Ejemplo n.º 8
0
        public void ECS_SetAndGetThreshold_Simplecases(int a, int expected)
        {
            var uut = new ECS(0, new FakeTempSensor(), new FakeHeater(), new FakeWindow());

            uut.SetThreshold(a);

            Assert.That(uut.GetThreshold(), Is.EqualTo(expected));
        }
Ejemplo n.º 9
0
        public void Regulate_CorrectLogRes(int thresh, int temp, string logRes)
        {
            uut.SetThreshold(thresh);
            _fakeTempSensor.Temp = temp;

            uut.Regulate();
            Assert.That(_fakeHeater.Log.Log, Is.EqualTo(logRes));
        }
Ejemplo n.º 10
0
        public void Regulate_TempOverThreshold_HeaterOff(int thr)
        {
            //Arrange

            //Tester metoden regulate at heateren turner off, når tærskelværdien ligger under den retunerede Fake-temperaturværdi på 24
            //Ønsker at der skal være koldere

            //Act

            uut.SetThreshold(thr);
            uut.Regulate();

            string state = "Heater Off";

            //Assert

            Assert.That(_fakeHeater.state, Is.EqualTo(state));
        }
Ejemplo n.º 11
0
        public void Regulate_SetThresholdAboveMaxTempRange_HeaterTurnsOn()
        {
            // Arrange

            uut.SetThreshold(21);

            // Act
            uut.Regulate();
        }
Ejemplo n.º 12
0
        public static void Main()
        {
            var ecs = new ECS(28, new TempSensor(), new Heater(), new Window(10));

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
        }
Ejemplo n.º 13
0
        public static void Main(string[] args)
        {
            var ecs = new ECS(28);

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
        }
        public static void Main(string[] args)
        {
            var ecs = new ECS(28, new TempSensor(), new Heater());

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
        }
Ejemplo n.º 15
0
        public static void Main(string[] args)
        {
            var ecs = new ECS(25, new TempSensor(), new Heater());

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
        }
Ejemplo n.º 16
0
        public static void Main(string[] args)
        {
            var ecs = new ECS(28, new TempSensor.TempSensor(), new Heater.Heater());

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
            System.Console.ReadKey();
        }
Ejemplo n.º 17
0
            public void TestWith(int th, int result)//State based test
            {
                //setup
                UUT.SetThreshold(th);

                //Act
                int threshold = UUT.GetThreshold();

                //Assert
                Assert.That(threshold, Is.EqualTo(result));
            }
Ejemplo n.º 18
0
        public static void Main(string[] args)
        {
            var ecs = new ECS(28, new TempSensor());

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();

            // init commit test
        }
Ejemplo n.º 19
0
        public static void Main(string[] args)
        {
            var sensor = new TempSensor();
            var heater = new Heater();
            var ecs    = new ECS(28, sensor, heater);

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
        }
Ejemplo n.º 20
0
        public static void Main(string[] args)
        {
            // Because of constructor injection, allocation is done in the constructor.
            // Ability to chose which derivatives one wants to work with
            var ecs = new ECS(28, new TempSensor(), new Heater());

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
        }
Ejemplo n.º 21
0
        public static void Main(string[] args)
        {
            ITempSensor _tempSensor = new TempSensor();
            IHeater     _heater     = new Heater();

            var ecs = new ECS(28, _heater, _tempSensor);

            ecs.Regulate();

            ecs.SetThreshold(20);

            ecs.Regulate();
        }
Ejemplo n.º 22
0
        public static void Main(string[] args)
        {
            //Create dependencies
            ITempSensor _tempSensor = new TempSensor();
            IHeater     _heater     = new Heater();

            //Create ECS sytem class
            var ecs = new ECS(28, _tempSensor, _heater);

            ecs.Regulate();


            ecs.SetThreshold(20);
        }
Ejemplo n.º 23
0
 public void TestSetTresHold_ResultOK()
 {
     uut.SetThreshold(4);
     Assert.That(uut.GetThreshold(), Is.EqualTo(4));
 }
Ejemplo n.º 24
0
 public void SetThreshold_Set20_ResultTrue(int a)
 {
     uut.SetThreshold(a);
     Assert.That(uut.GetThreshold(), Is.EqualTo(a));
 }
Ejemplo n.º 25
0
        public void SetThreshold_ReturnsCorrectThreshold(int thr, int result)
        {
            uut.SetThreshold(thr);

            Assert.That(uut.GetThreshold(), Is.EqualTo(result));
        }
Ejemplo n.º 26
0
        public void SetGetThresholdTest_ThresholdIs30()
        {
            UUT.SetThreshold(30);

            Assert.That(UUT.GetThreshold(), Is.EqualTo(30));
        }
Ejemplo n.º 27
0
 public void GetThreshold_ThresholdSetTo20_Returns20()
 {
     _uutEcs.SetThreshold(20);
     Assert.AreEqual(_uutEcs.GetThreshold(), 20);
 }
Ejemplo n.º 28
0
 public void SetThreshold_GetThreshold_TestCase(int a)
 {
     uut.SetThreshold(a);
     Assert.That(uut.GetThreshold(), Is.EqualTo(a));
 }
Ejemplo n.º 29
0
 public void SetThreshold_Test(int a)
 {
     _uut.SetThreshold(a);
     Assert.That(_uut.GetThreshold(), Is.EqualTo(a));
 }
Ejemplo n.º 30
0
 public void SetThreshold_initiateWithXChangeToY_ThresholdIsY(int X, int Y)
 {
     uut = new ECS(tempSensor, heater, X);
     uut.SetThreshold(Y);
     Assert.That(uut.GetThreshold(), Is.EqualTo(Y));
 }