Пример #1
0
        public void SetUp()
        {
            actionPlanService                      = A.Fake <IActionPlanService>();
            centresDataService                     = A.Fake <ICentresDataService>();
            courseDataService                      = A.Fake <ICourseDataService>();
            selfAssessmentService                  = A.Fake <ISelfAssessmentService>();
            supervisorService                      = A.Fake <ISupervisorService>();
            frameworkService                       = A.Fake <IFrameworkService>();
            notificationService                    = A.Fake <INotificationService>();
            frameworkNotificationService           = A.Fake <IFrameworkNotificationService>();
            candidateAssessmentDownloadFileService = A.Fake <ICandidateAssessmentDownloadFileService>();
            var logger = A.Fake <ILogger <LearningPortalController> >();

            config = A.Fake <IConfiguration>();
            filteredApiHelperService        = A.Fake <IFilteredApiHelperService>();
            searchSortFilterPaginateService = A.Fake <ISearchSortFilterPaginateService>();

            A.CallTo(() => config["CurrentSystemBaseUrl"]).Returns(BaseUrl);

            var user = new ClaimsPrincipal(
                new ClaimsIdentity(
                    new[]
            {
                new Claim("learnCandidateID", CandidateId.ToString()),
                new Claim("UserCentreID", CentreId.ToString()),
            },
                    "mock"
                    )
                );

            controller = new LearningPortalController(
                centresDataService,
                courseDataService,
                selfAssessmentService,
                supervisorService,
                frameworkService,
                notificationService,
                frameworkNotificationService,
                logger,
                config,
                actionPlanService,
                candidateAssessmentDownloadFileService,
                searchSortFilterPaginateService,
                multiPageFormService
                );
            controller.ControllerContext = new ControllerContext {
                HttpContext = new DefaultHttpContext {
                    User = user
                }
            };
            controller = controller.WithMockTempData();
        }
Пример #2
0
 public RecommendedLearningController(
     IFilteredApiHelperService filteredApiHelperService,
     ISelfAssessmentService selfAssessmentService,
     IConfiguration configuration,
     IRecommendedLearningService recommendedLearningService,
     IActionPlanService actionPlanService
     )
 {
     this.filteredApiHelperService   = filteredApiHelperService;
     this.selfAssessmentService      = selfAssessmentService;
     this.configuration              = configuration;
     this.recommendedLearningService = recommendedLearningService;
     this.actionPlanService          = actionPlanService;
 }
Пример #3
0
        public void Setup()
        {
            filteredApiHelperService   = A.Fake <IFilteredApiHelperService>();
            selfAssessmentService      = A.Fake <ISelfAssessmentService>();
            configuration              = A.Fake <IConfiguration>();
            recommendedLearningService = A.Fake <IRecommendedLearningService>();
            actionPlanService          = A.Fake <IActionPlanService>();

            controller = new RecommendedLearningController(
                filteredApiHelperService,
                selfAssessmentService,
                configuration,
                recommendedLearningService,
                actionPlanService
                )
                         .WithDefaultContext()
                         .WithMockUser(true, delegateId: DelegateId);
        }