Exemplo n.º 1
0
        public void Setup()
        {
            courseService = A.Fake <ICourseService>();
            courseDelegatesDownloadFileService = A.Fake <ICourseDelegatesDownloadFileService>();
            searchSortFilterPaginateService    = A.Fake <ISearchSortFilterPaginateService>();

            A.CallTo(() => courseService.GetCentreCourseDetailsWithAllCentreCourses(A <int> ._, A <int?> ._))
            .Returns(details);
            A.CallTo(() => courseService.GetApplicationOptionsAlphabeticalListForCentre(A <int> ._, A <int?> ._, A <int?> ._))
            .Returns(applicationOptions);

            httpRequest  = A.Fake <HttpRequest>();
            httpResponse = A.Fake <HttpResponse>();

            const string cookieValue = "Status|Active|false";

            controllerWithCookies = new DelegateCoursesController(
                courseService,
                courseDelegatesDownloadFileService,
                searchSortFilterPaginateService
                )
                                    .WithMockHttpContext(httpRequest, CookieName, cookieValue, httpResponse)
                                    .WithMockUser(true, 101)
                                    .WithMockTempData();
        }
Exemplo n.º 2
0
 public DelegateCoursesController(
     ICourseService courseService,
     ICourseDelegatesDownloadFileService courseDelegatesDownloadFileService,
     ISearchSortFilterPaginateService searchSortFilterPaginateService
     )
 {
     this.courseService = courseService;
     this.courseDelegatesDownloadFileService = courseDelegatesDownloadFileService;
     this.searchSortFilterPaginateService    = searchSortFilterPaginateService;
 }
Exemplo n.º 3
0
        public void SetUp()
        {
            courseAdminFieldsService           = A.Fake <ICourseAdminFieldsService>();
            courseDelegatesService             = A.Fake <ICourseDelegatesService>();
            courseDelegatesDownloadFileService = A.Fake <ICourseDelegatesDownloadFileService>();
            searchSortFilterPaginateService    = A.Fake <ISearchSortFilterPaginateService>();

            controller = new CourseDelegatesController(
                courseAdminFieldsService,
                courseDelegatesService,
                courseDelegatesDownloadFileService,
                searchSortFilterPaginateService
                )
                         .WithDefaultContext()
                         .WithMockUser(true, UserCentreId);
        }