public void TemperatureChanged_LowTemperatur_HeaterOffNotCalled(int newTemp)
 {
     _tempSource.TempChangedEvent += Raise.EventWith(new TempChangedEventArgs {
         Temp = newTemp
     });
     _heater.DidNotReceive().TurnOff();
 }
Example #2
0
        public void Regulate_OkTemp_NoActionOnHeater()
        {
            _tempSensor.GetTemp().Returns(25);
            _uut.Regulate();

            _heater.DidNotReceive().TurnOn();
            _heater.DidNotReceive().TurnOff();
        }
Example #3
0
        public void Regulate_TempIsBetweenLowerAndUpperThresholds_HeaterIsTurnedOff(int testTemp)
        {
            // Setup the stub with desired response
            _fakeTempSensor.GetTemp().Returns(testTemp);
            _uut.Regulate();

            // Assert on the mock - was the heater called correctly
            _fakeHeater.DidNotReceive().TurnOn();
        }
Example #4
0
        public void Regulate_TempIsBetweenLowerAndUpperThresholds_HeaterIsTurnedOff()
        {
            // Raise event in fake
            _fakeTempSensor.TempChangedEvent += Raise.EventWith <TempChangedEventArgs>(
                this,
                new TempChangedEventArgs()
            {
                Temp = 27
            });

            // Assert on the mock - was the heater called correctly
            _fakeHeater.DidNotReceive().TurnOn();
        }