Exemplo n.º 1
0
 public MobileDevice(string manufacturer, string model, Battery battery, Display display, string owner = null, decimal? price = null)
     : this(manufacturer, model)
 {
     this.Model = model;
     this.Manufacturer = manufacturer;
     this.Price = price;
     this.Owner = owner;
     this.battery = battery;
     this.display = display;
 }
Exemplo n.º 2
0
        static void Main()
        {
            MobileDevice[] deviceLot = new MobileDevice[4];
            Battery battery = new Battery(BatteryType.LiIon, BatteryColor.Grey, 100, 10);
            Display display = new Display(256000);
            deviceLot[0] = new MobileDevice("HTC", "Desire X", 429.99m, "PEshko");
            deviceLot[1] = new MobileDevice("HTC", "One", 809.99m, "Goshko");
            deviceLot[2] = new MobileDevice("Apple", "iPhoneS4", battery, display);
            deviceLot[3] = new MobileDevice("Nokia", "Lumnia");

            foreach (var device in deviceLot)
            {
                Console.WriteLine(device.ToString());
            }

            CallHistoryTest.Test();
        }