public void ThenIShouldSeeErrorMessagesOnPage(Table table)
        {
            var searchResultValidations = table.CreateSet <SearchResultValidations>();

            var actualSubheaderforRestaurant  = StateManager.Get <string>(Result.RestaurantSubHeader.ToString());
            var emptySearchResultMessage      = StateManager.Get <string>(Result.EmptySearchResultMessage.ToString());
            var searchButtonInvalidSearchText = StateManager.Get <string>(Result.SearchButtonInvalidSearchText.ToString());
            var searchButtonInvalidSearchLink = StateManager.Get <string>(Result.SearchButtonInvalidSearchLink.ToString());
            var tipUsOffText = StateManager.Get <string>(Result.TipUsOffText.ToString());
            var tipUsOffLink = StateManager.Get <string>(Result.TipUsOffLink.ToString());

            foreach (var expected in searchResultValidations)
            {
                ValidationHelper.AssertTrue(actualSubheaderforRestaurant, expected.Subheader);

                ValidationHelper.AssertTrue(emptySearchResultMessage, expected.EmptySearchResultMessage);

                ValidationHelper.AssertTrue(searchButtonInvalidSearchText, expected.SearchButtonText);

                ValidationHelper.AssertTrue(searchButtonInvalidSearchLink, expected.SearchButtonLink);

                ValidationHelper.AssertTrue(tipUsOffText, expected.TipUsOffText);

                ValidationHelper.AssertTrue(tipUsOffLink, expected.TipUsOffLink);
            }
        }
        public void ThenIShouldSeeTheRestaurantNameInTheSearhResult()
        {
            var searchedRestaurant = StateManager.Get <string>(Input.Restaurant.ToString());
            var firstSearchResult  = StateManager.Get <string>(Result.FirstSearchResult.ToString());
            var lastSearchResult   = StateManager.Get <string>(Result.LastSearchResult.ToString());

            ValidationHelper.AssertTrue(firstSearchResult, searchedRestaurant);

            ValidationHelper.AssertTrue(lastSearchResult, searchedRestaurant);
        }
        public void ThenIShouldSeeThePostcodeInTheSubheader()
        {
            var subheaderAfterRestaurantSearch = StateManager.Get <string>(Result.RestaurantSubHeader.ToString());
            var expectedPostcode = StateManager.Get <string>(Input.Postcode.ToString());
            var defaultHeaderForTotalRestaurants = StateManager.Get <string>(Result.DefaultSubheaderForGivenPostcode.ToString());

            ValidationHelper.AssertTrue(subheaderAfterRestaurantSearch, expectedPostcode);

            ValidationHelper.AssertNotEqual(subheaderAfterRestaurantSearch, defaultHeaderForTotalRestaurants);
        }
        public void ThenIShouldSeeErrorMessage(Table table)
        {
            var searchResultValidations = table.CreateSet <SearchResultValidations>();

            _searchPage.GetErrorInformationFromSearchPage();

            var actualPostcodeErrorMessage = StateManager.Get <string>(Result.PostCodeErrorMessage.ToString());

            foreach (var expected in searchResultValidations)
            {
                ValidationHelper.AssertTrue(actualPostcodeErrorMessage, expected.PostCodeErrorMessage);
            }
        }
        public void ThenTheSearchResultCountReflectsTheDetailsInTheSubHeader()
        {
            if (_searchResults._openRestaurantsAvailable)
            {
                var openRestaurantsSubHeaderValue    = StateManager.Get <int>(Result.OpenRestaurantsCountFromSubheader.ToString());
                var openRestaurantsSearchResultCount = StateManager.Get <int>(Result.OpenRestaurantsFromSearchResult.ToString());

                ValidationHelper.AssertEqual(openRestaurantsSearchResultCount, openRestaurantsSubHeaderValue);
            }
            else
            {
                var subheaderAfterRestaurantSearch = StateManager.Get <string>(Result.RestaurantSubHeader.ToString());

                ValidationHelper.AssertTrue(subheaderAfterRestaurantSearch, _openRestaurantUnavailableSubheader);
            }
        }