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

            // Then
            result.As <ViewResult>().Model.As <DelegateGroupsViewModel>().FilterBy.Should()
            .Be("LinkedToField|LinkedToField|0");
        }
Exemplo n.º 2
0
        public void Index_calls_expected_methods_and_returns_view()
        {
            // When
            var result = delegateGroupsController.Index();

            // Then
            using (new AssertionScope())
            {
                A.CallTo(() => groupsService.GetGroupsForCentre(A <int> ._)).MustHaveHappened();
                A.CallTo(
                    () => searchSortFilterPaginateService.SearchFilterSortAndPaginate(
                        A <IEnumerable <Group> > ._,
                        A <SearchSortFilterAndPaginateOptions> ._
                        )
                    ).MustHaveHappened();
                A.CallTo(
                    () => httpResponse.Cookies.Append(
                        CookieName,
                        A <string> ._,
                        A <CookieOptions> ._
                        )
                    )
                .MustHaveHappened();
                result.Should().BeViewResult().WithDefaultViewName();
            }
        }