Ejemplo n.º 1
0
 public void WhenSearchingForRestaurantWith_SE19_ShouldThrowExcptionWhenExternalURLIsDown()
 {
     string         BaseURI        = "https://blah/";
     FindRestaurant findRestaurant = new FindRestaurant(BaseURI);
     var            restaurant     = findRestaurant.WithOutCode("SE19");
     bool           any            = restaurant.Any(c => c.IsOpenNow == false);
 }
Ejemplo n.º 2
0
        public void WhenSearchingForRestaurantWith_SE19_ShouldReturn_FoodType()
        {
            string         BaseURI        = "https://public.je-apis.com/";
            FindRestaurant findRestaurant = new FindRestaurant(BaseURI);
            var            restaurant     = findRestaurant.WithOutCode("SE19");

            Assert.IsNotNull(restaurant[0].CuisineTypes[0].Name);
        }
Ejemplo n.º 3
0
        public void WhenSearchingForRestaurantWith_SE19_ShouldReturn_Rating()
        {
            string         BaseURI        = "https://public.je-apis.com/";
            FindRestaurant findRestaurant = new FindRestaurant(BaseURI);
            var            restaurant     = findRestaurant.WithOutCode("SE19");

            Assert.IsNotNull(restaurant[0].RatingStars);
        }
Ejemplo n.º 4
0
        public void WhenSearchingForRestaurantWith_BLANK_ShouldReturn_Null()
        {
            string         BaseURI        = "https://public.je-apis.com/";
            FindRestaurant findRestaurant = new FindRestaurant(BaseURI);
            var            restaurant     = findRestaurant.WithOutCode("");

            Assert.IsNull(restaurant);
        }
Ejemplo n.º 5
0
        public void WhenSearchingForRestaurantWith_SE19_ShouldReturnRestaurantWhichAreAvailable()
        {
            string         BaseURI        = "https://public.je-apis.com/";
            FindRestaurant findRestaurant = new FindRestaurant(BaseURI);
            var            restaurant     = findRestaurant.WithOutCode("SE19");
            bool           any            = restaurant.Any(c => c.IsOpenNow == false);

            Assert.IsFalse(any);
        }
Ejemplo n.º 6
0
        protected void Find_Click(object sender, EventArgs e)
        {
            RestaurantView.EmptyDataText = "No data available.";
            string         searchText     = [email protected];
            string         BaseURI        = ConfigurationManager.AppSettings["BaseURL"];
            FindRestaurant findRestaurant = new FindRestaurant(BaseURI);

            try
            {
                List <Restaurant> restaurants = findRestaurant.WithOutCode(searchText);
                RestaurantView.DataSource = restaurants;
                RestaurantView.DataBind();
            }
            catch (Exception)
            {
                RestaurantView.EmptyDataText = "Something got a bit wrong Please try again later";
                RestaurantView.DataBind();
            }
        }