예제 #1
0
        public void GetVendorLocations()
        {
            List <VendorLocationModel> vendorLocations = VendorLocationManager.GetVendorLocations();
            int expected = 2;

            Assert.AreEqual(vendorLocations.Count, expected);
        }
예제 #2
0
        public void Update()
        {
            VendorLocationModel vendorLocation = new VendorLocationModel
            {
                VendorID  = 2,
                LocationX = 111,
                LocationY = 222,
                Date      = new DateTime(1950, 12, 31)
            };

            VendorLocationManager.Update(vendorLocation);
            VendorLocationModel newVendorLocation = VendorLocationManager.GetVendorLocation(2);

            Assert.AreEqual(vendorLocation.VendorID, newVendorLocation.VendorID);
        }
예제 #3
0
        //private readonly ILogger<HomeController> _logger;

        //public HomeController(ILogger<HomeController> logger)
        //{
        //    _logger = logger;
        //}

        public ActionResult Index(string Cuisine)
        {
            List <VendorCuisineLocationRating> VCLR = new List <VendorCuisineLocationRating>();
            List <VendorModel> Vendors = VendorManager.GetActiveVendors();

            if (!string.IsNullOrEmpty(Cuisine))
            {
                ViewBag.Cuisine = Cuisine.ToLower();
            }

            foreach (VendorModel item in Vendors)
            {
                VCLR.Add(new VendorCuisineLocationRating
                {
                    Vendor         = item,
                    VendorLocation = VendorLocationManager.GetVendorLocations().Any(v => v.VendorID == item.VendorID) == false ? new VendorLocationModel(): VendorLocationManager.GetVendorLocation(item.VendorID),
                    Reviews        = ReviewManager.GetReviews(item.VendorID),
                    Cuisine        = CuisineManager.GetCuisines().Any(v => v.VendorID == item.VendorID) == false ? new CuisineModel() : CuisineManager.GetVendorCuisine(item.VendorID)
                });
            }
            return(View(VCLR));
        }
예제 #4
0
        public void Delete()
        {
            bool result = VendorLocationManager.Delete(2);

            Assert.IsTrue(result);
        }
예제 #5
0
        public void Seed()
        {
            bool result = VendorLocationManager.Seed();

            Assert.IsTrue(result);
        }