コード例 #1
0
 public StationaryAirConditioner(
     string manufacturer,
     string model,
     EfficiancyRating requiredEfficiancyRating,
     int powerUsage)
     : base(manufacturer, model)
 {
     this.PowerUsage = powerUsage;
     this.RequiredEfficiancyRating = requiredEfficiancyRating;
     this.ActualEfficiancyRating   = this.GetRating(powerUsage);
 }
コード例 #2
0
 public StationaryAirConditioner(
     string manufacturer,
     string model,
     EfficiancyRating requiredEfficiancyRating,
     int powerUsage)
     : base(manufacturer, model)
 {
     this.PowerUsage = powerUsage;
     this.RequiredEfficiancyRating = requiredEfficiancyRating;
     this.ActualEfficiancyRating = this.GetRating(powerUsage);
 }
コード例 #3
0
        public string RegisterStationaryAirConditioner(string manufacturer, string model, EfficiancyRating energyEfficiencyRating, int powerUsage)
        {
            var airConditioner = new StationaryAirConditioner(manufacturer, model, energyEfficiencyRating, powerUsage);

            this.Database.AddAirConditioner(airConditioner);

            string result = string.Format(Messages.RegisterAc, airConditioner.Model, airConditioner.Manufacturer);
            return result;
        }
コード例 #4
0
        public string RegisterStationaryAirConditioner(string manufacturer, string model, EfficiancyRating energyEfficiencyRating, int powerUsage)
        {
            var airConditioner = new StationaryAirConditioner(manufacturer, model, energyEfficiencyRating, powerUsage);

            this.Database.AddAirConditioner(airConditioner);

            string result = string.Format(Messages.RegisterAc, airConditioner.Model, airConditioner.Manufacturer);

            return(result);
        }
コード例 #5
0
        public void RegisterStationaryAirConditioner_IncorrectRating_ShouldThrow()
        {
            EfficiancyRating rating = (EfficiancyRating)Enum.Parse(typeof(EfficiancyRating), "Z");

            this.controller.RegisterStationaryAirConditioner("Lenovo", "GX2000", rating, 0);
        }