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)); }
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)); }
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)); }
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()); }
public string FindReport(string manufacturer, string model) { Reprot report = MyStuff.GetReport(manufacturer, model); throw new InvalidOperationException(report.ToString()); }
public string FindAirConditioner(string manufacturer, string model) { BlowWind airConditioner = MyStuff.GetAirConditioner(manufacturer, model); throw new InvalidOperationException(airConditioner.ToString()); }