예제 #1
0
 public void RunSelfTest_TestIsOK_ReturnTrue()
 {
     _tempSensor.RunSelfTest().Returns(true);
     _heater.RunSelfTest().Returns(true);
     _window.RunSelfTest().Returns(true);
     Assert.IsTrue(_uut.RunSelfTest());
 }
예제 #2
0
 public void RunSelfTest_Success_SelftestApproved()
 {
     _heater.RunSelfTest().Returns(true);
     _sensor.RunSelfTest().Returns(true);
     _window.RunSelfTest().Returns(true);
     Assert.IsTrue(_uut.RunSelfTest());
 }
예제 #3
0
        public void Test_RunSelfTest_2false_false()
        {
            _uut = new ECSClass(25, 35, _fakeTempSensor, _fakeHeater, _fakeWindow);

            _fakeHeater.RunSelfTest().Returns(false);
            _fakeTempSensor.RunSelfTest().Returns(false);

            Assert.IsFalse(_uut.RunSelfTest());
        }
예제 #4
0
        public void RunSelfTest_SelfTestReturnsTrue()
        {
            // Act

            _tempSensor.RunSelfTest().Returns(true);
            _heater.RunSelfTest().Returns(true);

            Assert.IsTrue(_uut.RunSelfTest());
            // Assert
        }
예제 #5
0
 public void RunSelfTest_StubsSetToXandY_ExpectZ(bool X, bool Y, bool Z)
 {
     uut = new ECS(tempSensor, heater, 10);
     tempSensor.RunSelfTest().Returns(X);
     heater.RunSelfTest().Returns(Y);
     Assert.That(uut.RunSelfTest, Is.EqualTo(Z));
 }
예제 #6
0
        public void SelfTest_CallMethodSelfTest_ResultIsTrue()
        {
            bool test;

            test = uut.RunSelfTest();
            Assert.That(test, Is.True);
        }
예제 #7
0
 public bool RunSelfTest()
 {
     return
         (_tempSensor.RunSelfTest()
          &&
          _heater.RunSelfTest()
          &&
          _window.RunSelfTest());
 }
예제 #8
0
        public void RunSelfTest_StubsReturnsAllBoolValues_ReturnsCorrectBool(bool heaterBool, bool sensorBool, bool result)
        {
            _heater.RunSelfTest().Returns(heaterBool);
            _tempSensor.RunSelfTest().Returns(sensorBool);
            // work is done in setup
            bool selfTestResult = uut.RunSelfTest();

            Assert.That(selfTestResult, Is.EqualTo(result));
        }
예제 #9
0
        public void RunSelftest_AllSubtestsPass_ReturnsTrue(
            bool TempTest,
            bool HeaterTest,
            bool WindowTest,
            bool ExpectedResult)
        {
            _fakeTempSensor.RunSelfTest().Returns(TempTest);
            _fakeHeater.RunSelfTest().Returns(HeaterTest);
            _fakeWindow.RunSelfTest().Returns(WindowTest);

            Assert.That(_uut.RunSelfTest(), Is.EqualTo(ExpectedResult));
        }
        public void RunSelfTest_StubsSetToXandY_ExpectZ(bool X, bool Y, bool Z)
        {
            //Arrange
            _fakeHeater.RunSelfTest().Returns(X);
            _fakeTempSensor.RunSelfTest().Returns(Y);

            //Act
            bool result = uut.RunSelfTest();

            //Assert
            Assert.That(result, Is.EqualTo(Z));
        }
예제 #11
0
        public void RunSelfTest_HeaterFails_SelfTestFails(int a)
        {
            //arrange
            uut2 = Substitute.For <IHeater>();
            uut1 = Substitute.For <ITempSensor>();
            uut3 = new global::ECS.Legacy.ECS(a, uut2, uut1);

            //act
            uut1.RunSelfTest().Returns(true);
            uut2.RunSelfTest().Returns(true);

            //uut3.Regulate();

            //assert
            Assert.IsTrue(uut3.RunSelfTest());
        }
예제 #12
0
 public void RunSelfTest_HeaterSensor_Res(bool hSelftest, bool tSSelfTest, bool res)
 {
     _fakeHeater.RunSelfTest().Returns(hSelftest);
     _fakeTempSensor.RunSelfTest().Returns(tSSelfTest);
     Assert.That(_uut.RunSelfTest() == res);
 }
예제 #13
0
 public bool RunSelfTest()
 {
     return(_tempSensor.RunSelfTest() && _heater.RunSelfTest() && _Window.RunSelfTest());
 } // Lavet ændring
예제 #14
0
 public void RunSelfTest_retuns_true()
 {
     uutTempSensor.RunSelfTest().Returns(true);
     uutHeater.RunSelfTest().Returns(true);
     Assert.That(uut.RunSelfTest, Is.True);
 }
예제 #15
0
 public void tempSensorFailedTest()
 {
     tempSensor_.RunSelfTest().Returns(false);
     heater_.RunSelfTest().Returns(true);
     Assert.IsFalse(ecs_.RunSelfTest());
 }
예제 #16
0
 public void RunSelfTest_ReturnsFalse()
 {
     temp.RunSelfTest().Returns(false);
     heater.RunSelfTest().Returns(true);
     Assert.IsFalse(uut.RunSelfTest());
 }
예제 #17
0
 public bool RunSelfTest()
 {
     return(_heater.RunSelfTest() & _tempSensor.RunSelfTest());
 }
예제 #18
0
 public void RunSelfTest_Test(bool hReturn, bool tReturn, bool Result)
 {
     _fakeTempSensor.RunSelfTest().Returns(tReturn);
     _fakeHeater.RunSelfTest().Returns(hReturn);
     Assert.That(_uut.RunSelfTest(), Is.EqualTo(Result));
 }
예제 #19
0
 public bool RunSelfTest(ITempSensor tempSensor, IHeater heater)
 {
     return(tempSensor.RunSelfTest() && heater.RunSelfTest());
 }
예제 #20
0
 public void SelfTest_CallMethodSelfTest_ResultIsTrue()
 {
     uut.RunSelfTest();
     Assert.IsTrue(uut.RunSelfTest());
 }
예제 #21
0
 public void HeaterRunSelfTestReturnsTrue()
 {
     Assert.IsTrue(_heater.RunSelfTest());
 }
예제 #22
0
파일: ECS.cs 프로젝트: TeamSWT34/Grup34_ECS
 public bool RunSelfTest() => _tempSensor.RunSelfTest() && _heater.RunSelfTest();
예제 #23
0
 public void RunSelfTest_SelfTestFails_TempOrHeaterIsFalse(bool temp, bool heater)
 {
     _tempSensor.RunSelfTest().Returns(temp);
     _heater.RunSelfTest().Returns(heater);
     Assert.IsFalse(_uut.RunSelfTest());
 }
예제 #24
0
 public void RunSelfTest_HeaterBoolSensorBool_ResultCorrect(bool heaterState, bool sensorState, bool expectedResult)
 {
     heater.RunSelfTest().Returns(heaterState);
     sensor.RunSelfTest().Returns(sensorState);
     Assert.That(uut.RunSelfTest, Is.EqualTo(expectedResult));
 }
예제 #25
0
 public void RunSelfTest_TempSensorFails_SelfTestFails()
 {
     _tempSensor.RunSelfTest().Returns(false);
     _heater.RunSelfTest().Returns(true);
     Assert.IsFalse(_uut.RunSelfTest());
 }
예제 #26
0
 public void RunSelfTest()
 {
     _tempsensor.RunSelfTest().Returns(false);
     _heater.RunSelfTest().Returns(true);
     Assert.IsFalse(_uut.RunSelfTest());
 }