public void InitializeTestController() { this.testManufacturers = new [] { "SomeManufacturer", "SomeManufacturer" }; string[] testModels = { "SomeModel", "AnotherModel"}; string[] testEnergyEfficiencyRatings = { "A", "B" }; const int TestMark = 0; const int TestPowerUsage = 5; const int NumberOfReports = 2; this.testAirConditioner = new AirConditioner( this.testManufacturers[0], testModels[0], testEnergyEfficiencyRatings[0], TestPowerUsage); this.testReports = new Report[NumberOfReports]; for (int i = 0; i < NumberOfReports; i++) { this.testReports[i] = new Report(this.testManufacturers[i], testModels[i], TestMark); } this.testRepository = new Repository(); }
public void AddAirConditioner(AirConditioner airConditioner) { string key = this.ConcatStrings(airConditioner.Manufacturer, airConditioner.Model); if (this.AirConditioners.ContainsKey(key)) { throw new DuplicateEntryException(Constants.Duplicate); } this.AirConditioners.Add(key, airConditioner); }
private string RegisterStationaryAirConditioner(string manufacturer, string model, string energyEfficiencyRating, int powerUsage) { AirConditioner airConditioner = new AirConditioner(manufacturer, model, energyEfficiencyRating, powerUsage); this.repository.AddAirConditioner(airConditioner); return string.Format(Constants.Register, airConditioner.Model, airConditioner.Manufacturer); }
public void RemoveAirConditioner(AirConditioner airConditioner) { string key = this.ConcatStrings(airConditioner.Manufacturer, airConditioner.Model); this.AirConditioners.Remove(key); }
/// <summary> /// Register an air conditioner which will be used in a plane. /// </summary> /// <param name="manufacturer">The manufacturer of the air conditioner.</param> /// <param name="model">The manufacturer of the air conditioner.</param> /// <param name="volumeCoverage">The volume coverege of the air conditioner.</param> /// <param name="electricityUsed">The electricity used by the air conditioner.</param> /// <returns>Returns a string with information about the registered air conditioner.</returns> private string RegisterPlaneAirConditioner(string manufacturer, string model, int volumeCoverage, string electricityUsed) { AirConditioner airConditioner = new AirConditioner(manufacturer, model, volumeCoverage, electricityUsed); this.repository.AddAirConditioner(airConditioner); return string.Format(Constants.Register, airConditioner.Model, airConditioner.Manufacturer); }