Ejemplo n.º 1
0
        public void AddAndGetInfoForOneCar()
        {
            GreenRepository repoInfo      = new GreenRepository();
            GreenPlan       customerInfo  = new GreenPlan(1, 2015, "Honda", "Sonata", 32d, CarType.Hybrid);
            GreenPlan       customerInfo2 = new GreenPlan(2, 2010, "Honda", "Sonata", 32d, CarType.Hybrid);

            repoInfo.AddCarToList(customerInfo);
            repoInfo.AddCarToList(customerInfo2);

            var expected = customerInfo2;
            var actual   = repoInfo.GetCarInfo(2);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void AddAndGetListOfCars()
        {
            GreenRepository repoInfo      = new GreenRepository();
            GreenPlan       customerInfo  = new GreenPlan(1, 2015, "Honda", "Sonata", 32d, CarType.Hybrid);
            GreenPlan       customerInfo2 = new GreenPlan(2, 2010, "Honda", "Sonata", 32d, CarType.Hybrid);

            repoInfo.AddCarToList(customerInfo);
            repoInfo.AddCarToList(customerInfo2);
            List <GreenPlan> list = repoInfo.GetAllCarInfo();

            var expected = 2;
            var actual   = list.Count;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void RemoveCarFromList()
        {
            GreenRepository _greenRepo = new GreenRepository();
            Car             car        = new Car(CarType.Gas, "Honda", "Accord", 2009, 4, 256);

            Car carTwo = new Car();

            _greenRepo.AddCarToList(car);
            _greenRepo.AddCarToList(carTwo);

            _greenRepo.RemoveCarFromList(256);

            int actual   = _greenRepo.SeeAllCarsOnList().Count;
            int expected = 1;

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void AddCarToListTest()

        {
            GreenRepository _greenRepo = new GreenRepository();
            Car             car        = new Car(CarType.Gas, "Honda", "Accord", 2009, 4, 256);


            _greenRepo.AddCarToList(car);

            List <Car> list = _greenRepo.SeeAllCarsOnList();

            int actual   = list.Count;
            int expected = 1;

            Assert.AreEqual(expected, actual);
            Assert.IsTrue(list.Contains(car));
        }