static void Main(string[] args)
        {
            Laptop asus = new Laptop("Asus X550jk", 1569, new Battery("Li - ION", 4), "Asus", "Intel Core i7-4710HQ (4-ядрен, 2.50 - 3.50 GHz, 6MB кеш)", 8, "NVIDIA GeForce GTX 850M (2GB DDR3)", "1TB HDD (5400 оборотa/минута) + 128 SSD", "15.6-инчов (39.62 см.) - 1366x768, матов");
            Laptop apple = new Laptop("1kg Qbalki", 1499.99, new Battery("mnogo zle", 2), "Apple");

            Console.WriteLine(asus);
            Console.WriteLine(apple);
        }
Beispiel #2
0
 static void Main()
 {
     Laptop ibm = new Laptop("IBM",2999);
     Laptop lenovo = new Laptop("Yoga",3999,"Intel Core i7",4);
     lenovo.LaptopBattery  = new Battery("LiIon", 4, 500);
     Console.WriteLine(ibm);
     Console.WriteLine();
     Console.WriteLine(lenovo);
 }
 static void Main()
 {
     Laptop temp1 = new Laptop("Lenovo Y50", "Lenovo", "Intel Core i7-4770k (quad-core, 2.20 - 3.20 GHz)",
         8, "GeForce GTX870m", "256GB SSD", "15.6\"  – 3200 x 1800(QHD +)",
         new Battery("Li-Ion, 6-cells, 3600 mAh", 6.0), 1800.00m);
     Laptop temp2 = new Laptop("Dell", 799.99m);
     Console.WriteLine(temp1);
     Console.WriteLine(temp2);
 }
        static void Main(string[] args)
        {
            Battery first = new Battery("Li-Ion, 4-cells, 2550 mAh", 4.5);
            Laptop fullInfo = new Laptop("Lenovo Yoga 2 Pro", "Lenovo", "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)", "8 GB", "Intel HD Graphics 4400",
                "128GB SSD", "\"13.3\"(33.78 cm) – 3200 x 1800(QHD +), IPS sensor display",first,  2259.00m);
            Laptop sampleInfo = new Laptop("HP 250 G2", 699.0m);

            Console.WriteLine("Full info: \n"+fullInfo.ToString());

            Console.WriteLine();
            Console.WriteLine("Sample info: \n"+sampleInfo.ToString());
        }
        static void Main()
        {
            Laptop laptop = new Laptop("Lenovo Yoga 2 Pro", 2259.00m, new Battery("Li-Ion, 4-cells, 2550 mAh", 4.5));
            laptop.Manufacturer = "Lenovo";
            laptop.Processor = "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)";
            laptop.RAM = 8;
            laptop.GraphicsCard = "Intel HD Graphics 4400";
            laptop.HDD = 128;
            laptop.Screen = @"13.3"" (33.78 cm) - 3220 x 1800 (QHD+), IPS sensor display";

            Console.WriteLine(laptop);
        }
 public void BatteryType_WhenBatteryTypeIsEmpty_ShouldThrowArgumentNullException()
 {
     var laptopWithFullInfo = new Laptop(
         "Lenovo Yoga 2 Pro",
         2259.00m,
         "Lenovo",
         "13.3 inches (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display)",
         "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
         "8 GB",
         "128GB SSD",
         "Intel HD Graphics 4400",
         new Battery(string.Empty, 4, 2550, 4.5));
 }
 public void BatteryNumberOfCells_WhenBatteryNumberOfCellsIsNegative_ShouldThrowArgumentOutOfRangeException()
 {
     var laptopWithFullInfo = new Laptop(
         "Lenovo Yoga 2 Pro",
         2259.00m,
         "Lenovo",
         "13.3 inches (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display)",
         "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
         "8 GB",
         "128GB SSD",
         "Intel HD Graphics 4400",
         new Battery("Li-Ion", -4, 2550, 4.5));
 }
Beispiel #8
0
        static void Main(string[] args)
        {
            Battery battery = new Battery("Li-Ion", 4, 2550, 4.5);

            Laptop hpPC = new Laptop("HP 250 G2", 699.00);

            Laptop lenovoPC = new Laptop("Lenovo Yoga Pro 2", "Lenovo", "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)", "8 GB", "Intel HD Graphics 4400", "128GB SSD", "13.3\"(33.78 cm) – 3200 x 1800(QHD +), IPS sensor display", battery, 2259.00);

            Console.WriteLine(hpPC.ToString());

            Console.WriteLine(lenovoPC.ToString());


        }
        public static void Main(string[] args)
        {
            Laptop laptopWithFullInfo = new Laptop(
                "Lenovo Yoga 2 Pro",
                2259.00m,
                "Lenovo",
                "13.3 inches (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display)",
                "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
                "8 GB",
                "128GB SSD",
                "Intel HD Graphics 4400",
                new Battery("Li-Ion", 4, 2550, 4.5));

            Console.WriteLine(laptopWithFullInfo);

            Laptop laptopWithMandatoryInfoOnly = new Laptop("HP 250 G2", 699.00m);

            Console.WriteLine(laptopWithMandatoryInfoOnly);
        }
Beispiel #10
0
 public static void Main()
 {
     try
     {
         Laptop acer = new Laptop(model: "Acer", price: 13.5m, hdd: 500, batteryType: "Li-On");
         Console.WriteLine(acer);
     }
     catch (ArgumentOutOfRangeException ex)
     {
         Console.WriteLine(ex);
     }
     catch (ArgumentException ex)
     {
         Console.WriteLine(ex);
     }          
     catch (Exception ex)
     {
         Console.WriteLine(ex);
     }
 }
Beispiel #11
0
        static void Main()
        {
            Laptop laptop1 = new Laptop(
                "Lenovo Yoga 2 Pro",
                2259.00m,
                "Lenovo",
                "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
                8,
                "Intel HD Graphics 4400",
                "128GB SSD",
                "13.3\" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display",
                "Li-Ion, 4-cells, 2550 mAh",
                4.5);

            Laptop laptop2 = new Laptop("HP 250 G2", 699.00m);

            Console.WriteLine(laptop1.ToString());
            Console.WriteLine(laptop2.ToString());

            //Laptop laptop3 = new Laptop("", -1);
        }
Beispiel #12
0
 static void Main(string[] args)
 {
     Laptop laptop = new Laptop(
         "Lenovo Yoga Pro 2",
         "Lenovo",
         "Intel Core i5-4210U ",
         "8 GB",
         "Intel HD Graphics 4400",
         "128GB SSD",
         "13.3\"(33.78 cm)–3200 x 1800(QHD +)\"",
         new Battery(4, 2250, BatteryType.LiIon),
         4.5,
         2259.00M);
     Laptop laptop2 = new Laptop("HP 250 G2", 699.00M);
     Console.WriteLine(laptop);
     Console.WriteLine(laptop2);
     Laptop lap = new Laptop();
     lap.Model = "Hp";
     lap.Price = 123.00M;
     lap.Screen = "IPS";
     Console.WriteLine(lap);
 }
Beispiel #13
0
        static void Main()
        {
            var hp = new Laptop("HP 250 G2", 699.096m);

            var lenovo = new Laptop("Lenovo Yoga 2 Pro", "Lenovo",
                                    "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)", "8 GB", "Intel HD Graphics 4400",
                                    "128GB SSD", "13.3\"(33.78 cm) – 3200 x 1800(QHD +), IPS sensor display", 2259,
                                    new Battery()
            {
                Type  = "Li-Ion",
                Cells = 4,
                MAh   = 2550,
                Life  = 4.5
            });

            var dell = new Laptop("Dell XPS 13", "Dell", "5th Generation Intel® Core™ i3-5010U Processor (3M Cache, 2.10 GHz)",
                                  "12 GB", "Intel (R) HD Graphics 5500", "128GB Solid State Drive",
                                  "13.3-inch FHD (1920 x 1080) InfinityEdge Display", 1549.99m);

            Console.WriteLine(hp);
            Console.WriteLine(lenovo);
            Console.WriteLine(dell);
        }
Beispiel #14
0
        static void Main()
        {
            Laptop toshiba = new Laptop("Toshiba R2D2", 1000);
            Console.WriteLine(toshiba);
            Console.WriteLine();

            toshiba.Ram = "4 GB DDR3";
            toshiba.Battery = new Battery("Li-ion 2009", 4.5);

            Console.WriteLine(toshiba.Battery);
            Console.WriteLine();
            Console.WriteLine(toshiba);

            toshiba.Manufacturer = "Toshiba";
            toshiba.Processor = "Intel Core i7";
            toshiba.HDD = "1 TB";
            Console.WriteLine();

            Console.WriteLine(toshiba.Manufacturer);
            Console.WriteLine(toshiba.Processor);
            Console.WriteLine(toshiba.HDD);

               //var hp = new Laptop("HP", -6);  //<--- this will throw an Exception
        }
 public void Laptop_LaptopWithMandatoryInfoOnly_ShouldPassTest()
 {
     var laptopWithMandatoryInfoOnly = new Laptop("HP 250 G2", 699.00m);
 }
 public void Laptop_LaptopWithFullInfo_ShouldPassTest()
 {
     var laptopWithFullInfo = new Laptop(
         "Lenovo Yoga 2 Pro",
         2259.00m,
         "Lenovo",
         "13.3 inches (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display)",
         "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
         "8 GB",
         "128GB SSD",
         "Intel HD Graphics 4400",
         new Battery("Li-Ion", 4, 2550, 4.5));
 }
 public void Price_WhenPriceIsNegative_ShouldThrowArgumentOutOfRangeException()
 {
     var laptopWithEmptyModel = new Laptop("HP 250 G2", -699.00m);
 }
 public void Model_WhenModelIsEmpty_ShouldThrowArgumentNullException()
 {
     var laptopWithEmptyModel = new Laptop(string.Empty, 699.00m);
 }