Exemplo n.º 1
0
        public string TestAirConditioner(string manufacturer, string model)
        {
            AirConditioner airConditioner = MyStuff.GetAirConditioner(manufacturer, model);
            var            mark           = airConditioner.Test();

            MyStuff.Reports.Add(new Report(airConditioner.Manufacturer, airConditioner.Model, mark));
            throw new InvalidOperationException(string.Format(OutputMessages.TEST, model, manufacturer));
        }
Exemplo n.º 2
0
        public string Status()
        {
            int    reports         = MyStuff.GetReportsCount();
            double airConditioners = MyStuff.GetAirConditionersCount();

            double percent = reports / airConditioners;

            percent = percent * 100;
            return(string.Format(GoodStuff.GoodStuff.STATUS, percent));
        }
Exemplo n.º 3
0
        public string TestAirConditioner(string manufacturer, string model)
        {
            BlowWind airConditioner = MyStuff.GetAirConditioner(manufacturer, model);

            airConditioner.energyRating += 5;
            var mark = airConditioner.Test();

            MyStuff.Reports.Add(new Reprot(airConditioner.Manufacturer, airConditioner.Model, mark));
            throw new InvalidOperationException(string.Format(GoodStuff.GoodStuff.TEST, model, manufacturer));
        }
Exemplo n.º 4
0
        public string FindAllReportsByManufacturer(string manufacturer)
        {
            List <Reprot> reports = MyStuff.GetReportsByManufacturer(manufacturer);

            if (reports.Count == 0)
            {
                return(GoodStuff.GoodStuff.NOREPORTS);
            }

            reports = reports.OrderBy(x => x.Mark).ToList();
            StringBuilder reportsPrint = new StringBuilder();

            reportsPrint.AppendLine(string.Format("Reports from {0}:", manufacturer));
            reportsPrint.Append(string.Join(Environment.NewLine, reports));
            return(reportsPrint.ToString());
        }
Exemplo n.º 5
0
        public string FindReport(string manufacturer, string model)
        {
            Reprot report = MyStuff.GetReport(manufacturer, model);

            throw new InvalidOperationException(report.ToString());
        }
Exemplo n.º 6
0
        public string FindAirConditioner(string manufacturer, string model)
        {
            BlowWind airConditioner = MyStuff.GetAirConditioner(manufacturer, model);

            throw new InvalidOperationException(airConditioner.ToString());
        }