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(); }
public DelegateCoursesController( ICourseService courseService, ICourseDelegatesDownloadFileService courseDelegatesDownloadFileService, ISearchSortFilterPaginateService searchSortFilterPaginateService ) { this.courseService = courseService; this.courseDelegatesDownloadFileService = courseDelegatesDownloadFileService; this.searchSortFilterPaginateService = searchSortFilterPaginateService; }
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); }