Ejemplo n.º 1
0
        public async Task AddApprenticeshipFromResults_ReturnsRedirectResult_ToApprenticeshipDetailsPage()
        {
            var result = await _basketController.AddApprenticeshipFromResults(_addFromApprenticeshipResultsModel);

            result.Should().BeAssignableTo <RedirectToActionResult>();
            var redirect = (RedirectToActionResult)result;

            redirect.ControllerName.Should().Be("Fat");
            redirect.ActionName.Should().Be("Search");
            var routeValues = redirect.RouteValues;

            routeValues["Keywords"].Should().Be(_addFromApprenticeshipResultsModel.SearchQuery.Keywords);
            routeValues["Page"].Should().Be(_addFromApprenticeshipResultsModel.SearchQuery.Page);
            routeValues["ResultsToTake"].Should().Be(_addFromApprenticeshipResultsModel.SearchQuery.ResultsToTake);
            routeValues["SortOrder"].Should().Be(_addFromApprenticeshipResultsModel.SearchQuery.SortOrder);
            routeValues["SelectedLevels"].Should().Be(_addFromApprenticeshipResultsModel.SearchQuery.SelectedLevels);
        }