Exemplo n.º 1
0
        public void GetVendorLocations()
        {
            List <VendorLocationModel> vendorLocations = VendorLocationManager.GetVendorLocations();
            int expected = 2;

            Assert.AreEqual(vendorLocations.Count, expected);
        }
Exemplo n.º 2
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));
        }