Example #1
0
            private static Laptop CreateLaptop(string brand)
            {
                // Creating array of Color
                string[] color = "White Black Silver".Split();

                // Creating array of Include
                string[] include = "WirelessMouse BluetoothEarPhone BluetoothSpeaker LaptopBag ACPowerAdaptor".Split();

                // Creating array of pictures
                string[] handles = "apple asus acer hp lenovo dell".Split();

                Laptop laps = new Laptop
                {
                    Brand    = brand,
                    ModelNo  = random.Next(1000, 9999),
                    IsSsd    = random.NextDouble() < 0.4,
                    SerialNo = random.Next(10000000, 99999999),
                    Color    = color[random.Next(color.Length)],
                    Include  = new List <Includes>(),
                    Handle   = "Images\\" + handles[random.Next(handles.Length)] + ".png"
                };

                int numberOfInclude = random.Next(2, 4);

                for (int i = 0; i < numberOfInclude; i++)
                {
                }

                Includes.AddInclude(laps, random.Next(Includes.NUMBER_OF_INCLUDE), random.Next(2, 4));

                return(laps);
            }