Ejemplo n.º 1
0
        public void Index_with_no_query_parameters_uses_cookie_value_for_filterBy()
        {
            // When
            var result = emailDelegatesController.Index();

            // Then
            result.As <ViewResult>().Model.As <EmailDelegatesViewModel>().FilterBy.Should()
            .Be("JobGroupId|JobGroupId|1");
        }
Ejemplo n.º 2
0
        public void Index_calls_expected_methods_and_returns_view()
        {
            // When
            var result = emailDelegatesController.Index();

            // Then
            using (new AssertionScope())
            {
                A.CallTo(() => userService.GetDelegateUserCardsForWelcomeEmail(A <int> ._)).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();
            }
        }