Пример #1
0
        public void TurnOff_SetThresholdUnderTempAndRegulate_TurnOffCalledOnce(int a)
        {
            //arrange
            uut2 = Substitute.For <IHeater>();
            uut1 = Substitute.For <ITempSensor>();
            uut3 = new global::ECS.Legacy.ECS(a, uut2, uut1);

            //act
            uut1.GetTemp().Returns(5);
            uut3.Regulate();

            //assert
            uut2.Received(1).TurnOff();
        }
Пример #2
0
 public void Regulate_TempBelowThreshold_HeaterTurnedOn()
 {
     _tempSensor.GetTemp().Returns(_uut.GetThreshold1() - 10);
     _uut.Regulate();
     _heater.Received(1).TurnOn();
 }