public void Reports_WithRegisteredProducts_ShouldReturnCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var firstAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "P320", 25, 750); var thirdAc = view.RegisterStationaryAirConditioner("Toshiba", "C60", "A", 780); var firstTest = view.TestAirConditioner("Toshiba", "EX1000"); var secondTest = view.TestAirConditioner("Hitachi", "P320"); var thirdTest = view.TestAirConditioner("Toshiba", "C60"); var result = view.FindAllReportsByManufacturer("Toshiba"); var expected = new StringBuilder(); expected.AppendLine("Reports from Toshiba:"); expected.AppendLine("Report"); expected.AppendLine("===================="); expected.AppendLine("Manufacturer: Toshiba"); expected.AppendLine("Model: C60"); expected.AppendLine("Mark: Passed"); expected.AppendLine("===================="); expected.AppendLine("Report"); expected.AppendLine("===================="); expected.AppendLine("Manufacturer: Toshiba"); expected.AppendLine("Model: EX1000"); expected.AppendLine("Mark: Passed"); expected.Append("===================="); Assert.AreEqual(expected.ToString(), result); }
public void Reports_WithRegisteredProducts_ShouldReturnCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var firstAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "P320", 25, 750); var thirdAc = view.RegisterStationaryAirConditioner("Toshiba", "C60", "A", 780); var firstTest = view.TestAirConditioner("Toshiba", "EX1000"); var secondTest = view.TestAirConditioner("Hitachi", "P320"); var thirdTest = view.TestAirConditioner("Toshiba", "C60"); var result = view.FindAllReportsByManufacturer("Toshiba"); var expected = new StringBuilder(); expected.AppendLine("Reports from Toshiba:"); expected.AppendLine("Report"); expected.AppendLine("===================="); expected.AppendLine("Manufacturer: Toshiba"); expected.AppendLine("Model: C60"); expected.AppendLine("Mark: Passed"); expected.AppendLine("===================="); expected.AppendLine("Report"); expected.AppendLine("===================="); expected.AppendLine("Manufacturer: Toshiba"); expected.AppendLine("Model: EX1000"); expected.AppendLine("Mark: Passed"); expected.Append("===================="); Assert.AreEqual(expected.ToString(), result); }
public void Registering_IncorrectACEfficiencyRating_ShouldThrowException() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var registeredAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "F", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "", 25, 750); var thirdAc = view.RegisterCarAirConditioner("Toshiba", "C60", 9); }
public void Status_WithNoRegistered_Should_ReturnIncorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var result = view.Status(); Assert.AreEqual("Jobs complete: 0,00%", result); }
public void Registering_IncorrectACPowerUsage_ShouldThrowException() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var registeredAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "", 25, -200); var thirdAc = view.RegisterCarAirConditioner("Toshiba", "C60", 9); }
public void Status_WithNoRegistered_Should_ReturnIncorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var result = view.Status(); Assert.AreEqual("Jobs complete: 0,00%", result); }
public void Registering_CorrectAC_ShouldReturnCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var registeredAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var expected = "Air Conditioner model EX1000 from Toshiba registered successfully."; Assert.AreEqual(expected, registeredAc); }
public void Reports_WithNoRegisteredProducts_ShouldReturnCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var result = view.FindAllReportsByManufacturer("Toshiba"); var expected = "No reports."; Assert.AreEqual(expected, result); }
public void Reports_WithNoRegisteredProducts_ShouldReturnCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var result = view.FindAllReportsByManufacturer("Toshiba"); var expected = "No reports."; Assert.AreEqual(expected, result); }
public void Registering_CorrectAC_ShouldReturnCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var registeredAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var expected = "Air Conditioner model EX1000 from Toshiba registered successfully."; Assert.AreEqual(expected, registeredAc); }
public void Status_WithNoTested_Should_ReturnInCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var firstAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "P320", 25, 750); var thirdAc = view.RegisterCarAirConditioner("Toshiba", "C60", 9); var result = view.Status(); Assert.AreEqual("Jobs complete: 0,00%", result); }
public void Status_WithNoTested_Should_ReturnInCorrectly() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var firstAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "P320", 25, 750); var thirdAc = view.RegisterCarAirConditioner("Toshiba", "C60", 9); var result = view.Status(); Assert.AreEqual("Jobs complete: 0,00%", result); }
public void Reports_WithRegisteredProducts_ShouldReturnNoReports() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var firstAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "P320", 25, 750); var thirdAc = view.RegisterStationaryAirConditioner("Toshiba", "C60", "A", 780); var firstTest = view.TestAirConditioner("Toshiba", "EX1000"); var secondTest = view.TestAirConditioner("Toshiba", "C60"); var result = view.FindAllReportsByManufacturer("Hitachi"); var expected = "No reports."; Assert.AreEqual(expected, result); }
public void Reports_WithRegisteredProducts_ShouldReturnNoReports() { var userInterface = new ConsoleUserInterface(); var engine = new AirConditionerTestingSystemEngine(userInterface); var view = new AirConditionerView(engine); var firstAc = view.RegisterStationaryAirConditioner("Toshiba", "EX1000", "B", 1000); var secondAc = view.RegisterPlaneAirConditioner("Hitachi", "P320", 25, 750); var thirdAc = view.RegisterStationaryAirConditioner("Toshiba", "C60", "A", 780); var firstTest = view.TestAirConditioner("Toshiba", "EX1000"); var secondTest = view.TestAirConditioner("Toshiba", "C60"); var result = view.FindAllReportsByManufacturer("Hitachi"); var expected = "No reports."; Assert.AreEqual(expected, result); }
public AirConditionerTestingSystemEngine(IUserInterface userInterface) { this.airConditioner = new AirConditionerView(this); this.userInterface = userInterface; }
public AirConditionerTestingSystemEngine(IUserInterface userInterface) { this.airConditioner = new AirConditionerView(this); this.userInterface = userInterface; }