public static void GetCars()
        {
            List <Car> _list = _carRepo.GetCars();

            Console.WriteLine(String.Format("{0,-4} {1,-10} {2,-14} {3,-37} {4,-12} {5,-14} {6,-8}", "VID", "Engine", "Make", "Model", "Collision", "Comprehensive", "Injury"));
            foreach (var car in _list)
            {
                Console.WriteLine(String.Format("{0,-4} {1,-10} {2,-14} {3,-30} | {4,12} {5,12} {6,12}"
                                                , car.Id, car.Propulsion, car.Make, car.Model
                                                , car.Collision.ToString("P0"), car.Comprehensive.ToString("P0"), car.PersonalInjury.ToString("P0")

                                                ));
            }
        }
Example #2
0
        public void CreatingItems()
        {
            SeedThis();
            foreach (var item in _carList)
            {
                _carRepo.AddCar(item);
            }

            int itemCheck = _carRepo.GetCars().Count;

            Assert.AreEqual(2, itemCheck);
            Car item3 = new Car(3, "TestAdd", "TestModelADD", "electric", .1, .1, .1);

            _carRepo.AddCar(item3);
            //bool isAdded = _carRepo.AddCar(item3);
            Assert.AreEqual(2, itemCheck);
            Console.WriteLine(itemCheck);

            itemCheck = _carRepo.GetCars().Count;
            //  Assert.IsTrue(isAdded);
            Assert.AreEqual(3, itemCheck);
        }