public void TemperatureChanged_LowTemperatur_HeaterOffNotCalled(int newTemp) { _tempSource.TempChangedEvent += Raise.EventWith(new TempChangedEventArgs { Temp = newTemp }); _heater.DidNotReceive().TurnOff(); }
public void Regulate_OkTemp_NoActionOnHeater() { _tempSensor.GetTemp().Returns(25); _uut.Regulate(); _heater.DidNotReceive().TurnOn(); _heater.DidNotReceive().TurnOff(); }
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(); }
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(); }