Ejemplo n.º 1
0
        public void Setup()
        {
            centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>();
            groupsService = A.Fake <IGroupsService>();
            userService   = A.Fake <IUserService>();
            courseService = A.Fake <ICourseService>();

            A.CallTo(() => groupsService.GetGroupsForCentre(A <int> ._)).Returns(new List <Group>());
            A.CallTo(() => centreCustomPromptsService.GetCustomPromptsForCentreByCentreId(A <int> ._))
            .Returns(prompts);

            httpRequest  = A.Fake <HttpRequest>();
            httpResponse = A.Fake <HttpResponse>();
            const string cookieName  = "DelegateGroupsFilter";
            const string cookieValue = "LinkedToField|LinkedToField|0";

            delegateGroupsController = new DelegateGroupsController(
                centreCustomPromptsService,
                groupsService,
                userService,
                courseService
                )
                                       .WithMockHttpContext(httpRequest, cookieName, cookieValue, httpResponse)
                                       .WithMockUser(true)
                                       .WithMockServices()
                                       .WithMockTempData();
        }
        private ActionExecutingContext GetDefaultContext()
        {
            var delegateGroupsController = new DelegateGroupsController(
                A.Fake <ICentreRegistrationPromptsService>(),
                A.Fake <IGroupsService>(),
                A.Fake <ISearchSortFilterPaginateService>()
                ).WithDefaultContext().WithMockUser(true, UserCentreId);
            var context = ContextHelper.GetDefaultActionExecutingContext(delegateGroupsController);

            context.RouteData.Values["groupId"] = GroupId;

            return(context);
        }
Ejemplo n.º 3
0
        private ActionExecutingContext GetDefaultContext()
        {
            var delegateGroupsController = new DelegateGroupsController(
                A.Fake <ICentreCustomPromptsService>(),
                A.Fake <IGroupsService>(),
                A.Fake <IUserService>(),
                A.Fake <ICourseService>()
                ).WithDefaultContext().WithMockUser(true, UserCentreId);
            var context = ContextHelper.GetDefaultActionExecutingContext(delegateGroupsController);

            context.RouteData.Values["groupId"] = GroupId;

            return(context);
        }
Ejemplo n.º 4
0
        public void SetUp()
        {
            groupsService = A.Fake <IGroupsService>();

            var delegateGroupsController = new DelegateGroupsController(
                A.Fake <ICentreRegistrationPromptsService>(),
                A.Fake <IGroupsService>(),
                A.Fake <ISearchSortFilterPaginateService>()
                ).WithDefaultContext().WithMockUser(true);

            context = ContextHelper.GetDefaultActionExecutingContext(delegateGroupsController);
            context.RouteData.Values["groupId"] = GroupId;
            context.RouteData.Values["groupCustomisationId"] = GroupCustomisationId;
        }
Ejemplo n.º 5
0
        public void Setup()
        {
            centreRegistrationPromptsService = A.Fake <ICentreRegistrationPromptsService>();
            groupsService = A.Fake <IGroupsService>();
            searchSortFilterPaginateService = A.Fake <ISearchSortFilterPaginateService>();

            httpRequest  = A.Fake <HttpRequest>();
            httpResponse = A.Fake <HttpResponse>();
            const string cookieValue = "LinkedToField|LinkedToField|0";

            delegateGroupsController = new DelegateGroupsController(
                centreRegistrationPromptsService,
                groupsService,
                searchSortFilterPaginateService
                )
                                       .WithMockHttpContext(httpRequest, CookieName, cookieValue, httpResponse)
                                       .WithMockUser(true)
                                       .WithMockServices()
                                       .WithMockTempData();
        }