public void Index_calls_expected_methods_and_returns_view()
        {
            // When
            var result = allDelegatesController.Index();

            // Then
            using (new AssertionScope())
            {
                A.CallTo(() => userDataService.GetDelegateUserCardsByCentreId(A <int> ._)).MustHaveHappened();
                A.CallTo(() => jobGroupsDataService.GetJobGroupsAlphabetical())
                .MustHaveHappened();
                A.CallTo(() => centreRegistrationPromptsService.GetCentreRegistrationPromptsByCentreId(A <int> ._))
                .MustHaveHappened();
                A.CallTo(
                    () => searchSortFilterPaginateService.SearchFilterSortAndPaginate(
                        A <IEnumerable <DelegateUserCard> > ._,
                        A <SearchSortFilterAndPaginateOptions> ._
                        )
                    ).MustHaveHappened();
                A.CallTo(
                    () => httpResponse.Cookies.Append(
                        CookieName,
                        A <string> ._,
                        A <CookieOptions> ._
                        )
                    )
                .MustHaveHappened();
                result.Should().BeViewResult().WithDefaultViewName();
            }
        }
Exemplo n.º 2
0
        public void Index_with_no_query_parameters_uses_cookie_value_for_filterBy()
        {
            // When
            var result = allDelegatesController.Index();

            // Then
            result.As <ViewResult>().Model.As <AllDelegatesViewModel>().FilterBy.Should()
            .Be("ActiveStatus|Active|false");
        }