Example #1
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
        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 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 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);
        }
Example #9
0
        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);
        }
Example #10
0
        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);
        }
Example #11
0
        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);
        }
Example #14
0
        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);
        }
Example #15
0
        public static void Main()
        {
            var engine = new AirConditionerTestingSystemEngine(new ConsoleUserInterface());

            engine.Run();
        }
 public AirConditionerView(AirConditionerTestingSystemEngine run)
 {
     this.Run = run;
 }
 public static void Main()
 {
     var engine = new AirConditionerTestingSystemEngine(new ConsoleUserInterface());
     engine.Run();
 }
 public AirConditionerView(AirConditionerTestingSystemEngine run)
 {
     this.Run = run;
 }