예제 #1
0
        public void Test_AddRestaurant_ReturnValuesToLists()
        {
            var    lists         = new Lists();
            var    getData       = new GetData();
            var    addRestaurant = new AddRestaurant();
            int    i             = 0;
            string url           = "https://www.lounaat.info/jyvaskyla";

            var html = "";

            html = getData.SearchData(html, url);


            addRestaurant._AddRestaurant(lists.Names, lists.Meals, lists.Address, html);


            foreach (var item in addRestaurant.restaurantList)
            {
                if (i >= 1)
                {
                    Assert.AreNotEqual(lists.Names[i - 1], lists.Names[i]);
                    Assert.AreNotEqual(lists.Meals[i - 1], lists.Meals[i]);
                }
                Assert.IsNotNull(lists.Names[i]);
                Assert.IsNotNull(lists.Meals[i]);
                Assert.IsNotNull(lists.Address[i]);

                i++;
            }
        }
 public IActionResult SuggestRestaurant(AddRestaurant oNewRestaurant)
 {
     if (ModelState.IsValid) //check the field inputs if they are valid
     {
         Repository.AddResponse(oNewRestaurant);
         Response.Redirect("SuggestRestaurant");
         //Response.Redirect("SuggestRestaurant"); // if submission is taken, this will take info and show the add movie page with fields cleared
     }
     return(View());
 }
예제 #3
0
 public IActionResult AddRestaurant(AddRestaurant addRestaurant)
 {
     if (ModelState.IsValid)
     {
         TempStorage.AddRestaurant(addRestaurant);
         return(View("Confirmation", addRestaurant));
     }
     else
     {
         return(View("AddRestaurant"));
     }
 }
 public IActionResult RestaurantsForm(AddRestaurant appResponse)
 {
     if (ModelState.IsValid)
     {
         TempStorage.AddRestaurant(appResponse);
         return(View("Confirm", appResponse));
     }
     else
     {
         return(View());
     }
 }
예제 #5
0
 public IActionResult AddRestaurant(AddRestaurant appResponse)
 {
     //if user fills in all fields correctly, save in TempStorage and return Confirmation view
     if (ModelState.IsValid)
     {
         TempStorage.AddApplication(appResponse);
         return(View("Confirmation", appResponse));
     }
     //else display model validations on current page view
     else
     {
         return(View());
     }
 }
예제 #6
0
        public void Test_AddRestaurant_ListsAreEmpty()
        {
            var lists         = new Lists();
            var addRestaurant = new AddRestaurant();
            var html          = "";
            int i             = 0;


            addRestaurant._AddRestaurant(lists.Names, lists.Meals, lists.Address, html);

            foreach (var item in addRestaurant.restaurantList)
            {
                Assert.IsNull(lists.Names[i]);
                Assert.IsNull(lists.Meals[i]);
                Assert.IsNull(lists.Address[i]);
                i++;
            }
        }
 public virtual void AddRestaurant(AddRestaurant request)
 {
     throw new System.NotImplementedException();
 }
예제 #8
0
 public static void AddResponse(AddRestaurant response)
 {
     responses.Add(response);
 }
예제 #9
0
 public virtual void AddRestaurant(AddRestaurant request)
 {
     throw new System.NotImplementedException();
 }