public ActionResult Create(CarModel model)
        {
            if(ModelState.IsValid)
            {
                if (model.Id == 0)
                {

                    var newCar = new Car
                                     {
                                         Color = model.Color,
                                         OptionsMacroText = model.OptionsMacroText,
                                         Model = model.VehicleModel,
                                         Price = model.Price,
                                         SportsPackage = model.SportsPackage
                                     };

                    Repository.AddCar(newCar);
                    Repository.Context.SaveChanges();
                    model.Id = newCar.Id;
                    return View("Details", model);
                }
            }
            SetDropDownLists();
            return View("Create");
        }
        public ICarModel GetCarModel(ICar car)
        {
            var carModel = new CarModel
                               {
                                   Color = car.Color,

                                   Id = car.Id,
                                   OptionsMacroText = car.OptionsMacroText,
                                   Price = car.Price.HasValue ? car.Price.Value : 0.00M,
                                   SportsPackage = car.SportsPackage.HasValue ? car.SportsPackage.Value : false,
                                   VehicleModel = car.Model

                               };
            return (ICarModel) carModel;
        }
        public void CreateOptionsMacroTest()
        {
            ICarModel carModel = new CarModel
                                     {
                                         Id = 3,
                                         Color = "Platinum",
                                         SportsPackage = true,
                                         Price = 45000.99M,
                                         OptionsMacroText = "if(car.SportsPackage){ options.Add(\"6 inch Aero-Spoiler\"); }options.Add(\"Dual Exhaust\"); options.Add(\"Navigation Panel\");options.Add(\"Rear-Facing Camera\"); "

                                     };
            GenerateOptionsMacroFactory target = new GenerateOptionsMacroFactory(); // TODO: Initialize to an appropriate value
            var result = target.CreateOptionsMacro(carModel);
            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(IGenerateOptionsMacro));
        }