// Tests if Sauna is turned oFF public void Sauna_SetTemp() { //Arange Sauna testsauna = new Sauna(); //Act testsauna.setSaunaTemp(15); // Assert var result = testsauna.getSaunaTemp(); // method that returns temp of sauna Assert.AreEqual(15, result, "Sauna temperature error"); }
// Tests if Sauna is turned oFF public void Sauna_TimerUP() { Sauna testsauna = new Sauna(); testsauna.setSaunaTemp(15); for (int i = 0; i < 10; i++) { testsauna.saunaOn(); } // Loop simulates Datetimer (f.ex in 10 seconds temp will increase with +5C , saunaOn method increases by 0.5) var result = testsauna.getSaunaTemp(); // method that returns temp of sauna Assert.AreEqual(20, result, "Sauna timer temp INCREMENT"); }
// Tests if Sauna is turned oFF public void Sauna_TimerDOWN() { Sauna testsauna = new Sauna(); testsauna.setSaunaTemp(30); int roomTemp = 25; // Simulates room`s temp; for (int i = 0; i < 10; i++) { testsauna.saunaOff(roomTemp); } // Loop simulates Datetimer , saunaOff decrements by -1 , if its equal to room temp it doesnt drecrement more ) var result = testsauna.getSaunaTemp(); // method that returns temp of sauna Assert.AreEqual(25, result, "Sauna timer temp DECREMENT"); }