예제 #1
0
        public void CanAddVehicle()
        {
            var repo = new TestRepository();

            Vehicle vehicle = new Vehicle();

            var preAdd = repo.GetAll();

            VehicleMake vehicleMake = new VehicleMake()
            {
                Make  = "Lamborghini",
                Added = new DateTime(2017, 11, 17)
            };
            VehicleModel vehicleModel = new VehicleModel()
            {
                ModelType = "Centenario"
            };


            vehicle.BodyStyle.Description     = "Car";
            vehicle.ExteriorColor.Description = "Black";
            vehicle.InteriorColor.Description = "Black";
            vehicle.Feature      = true;
            vehicle.Image        = "Content/img/Lamborghini.jpg";
            vehicle.Mileage      = 1000;
            vehicle.MSRP         = 150000.00M;
            vehicle.New          = true;
            vehicle.SalePrice    = 160000.00M;
            vehicle.Transmission = "Manual";
            vehicle.VIN          = "11111111111111111";
            vehicle.Year         = 2017;
            vehicle.Description  = "It's a Lamborghini.";

            repo.AddVehicle(vehicle);

            var postAdd = repo.GetAll();

            Assert.AreEqual(preAdd.Count + 1, postAdd.Count);
        }