public void SetUp() { _tempSensor = new StubTempSensor(); _heater = new StubHeater(); _window = new StubWindow(); _myEnCoSy_with_window = new EnCoSy_with_window(15, 25, _tempSensor, _heater, _window); }
public void RunSelfTestReturnsCorrect(bool sensorRes, bool heatTest, bool windowTest) { //Arange _heater = new StubHeater(heatTest); _tempSensor = new StubTempSensor(0, sensorRes); _window = new StubWindow(windowTest); _myEnCoSy_with_window = new EnCoSy_with_window(0, 10, _tempSensor, _heater, _window); //Action //Assert Assert.That(_myEnCoSy_with_window.RunSelfTest(), Is.EqualTo(sensorRes && heatTest && windowTest)); }
public void EnCoSy_with_windowRegulateWindowCorrectly(int temp, int thrWindow, bool openClose) { //Arrange var dummyWindow = Substitute.For <IWindow>(); _tempSensor = new StubTempSensor(temp); _myEnCoSy_with_window = new EnCoSy_with_window(int.MinValue, thrWindow, _tempSensor, _heater, dummyWindow); //Action _myEnCoSy_with_window.Regulate(); //Assert if (openClose) { dummyWindow.Received(1).open(); } else { dummyWindow.Received(1).close(); } }