コード例 #1
0
        public void Setup()
        {
            groupsDataService                = A.Fake <IGroupsDataService>();
            clockService                     = A.Fake <IClockService>();
            tutorialContentDataService       = A.Fake <ITutorialContentDataService>();
            emailService                     = A.Fake <IEmailService>();
            progressDataService              = A.Fake <IProgressDataService>();
            configuration                    = A.Fake <IConfiguration>();
            centreRegistrationPromptsService = A.Fake <ICentreRegistrationPromptsService>();
            logger = A.Fake <ILogger <IGroupsService> >();
            jobGroupsDataService = A.Fake <IJobGroupsDataService>(x => x.Strict());

            A.CallTo(() => jobGroupsDataService.GetJobGroupsAlphabetical()).Returns(
                JobGroupsTestHelper.GetDefaultJobGroupsAlphabetical()
                );
            A.CallTo(() => configuration["AppRootPath"]).Returns("baseUrl");

            DatabaseModificationsDoNothing();

            groupsService = new GroupsService(
                groupsDataService,
                clockService,
                tutorialContentDataService,
                emailService,
                jobGroupsDataService,
                progressDataService,
                configuration,
                centreRegistrationPromptsService,
                logger
                );
        }
コード例 #2
0
 public LearningMenuController(
     ILogger <LearningMenuController> logger,
     IConfiguration config,
     IConfigService configService,
     ICourseContentService courseContentService,
     ISectionContentDataService sectionContentDataService,
     ITutorialContentDataService tutorialContentDataService,
     IDiagnosticAssessmentDataService diagnosticAssessmentDataService,
     IDiagnosticAssessmentService diagnosticAssessmentService,
     IPostLearningAssessmentService postLearningAssessmentService,
     ISessionService sessionService,
     ICourseCompletionService courseCompletionService
     )
 {
     this.logger                          = logger;
     this.config                          = config;
     this.configService                   = configService;
     this.courseContentService            = courseContentService;
     this.tutorialContentDataService      = tutorialContentDataService;
     this.sessionService                  = sessionService;
     this.sectionContentDataService       = sectionContentDataService;
     this.diagnosticAssessmentDataService = diagnosticAssessmentDataService;
     this.diagnosticAssessmentService     = diagnosticAssessmentService;
     this.postLearningAssessmentService   = postLearningAssessmentService;
     this.courseCompletionService         = courseCompletionService;
 }
コード例 #3
0
 public SectionService(
     ISectionContentDataService sectionContentDataService,
     ITutorialContentDataService tutorialContentDataService
     )
 {
     this.sectionContentDataService  = sectionContentDataService;
     this.tutorialContentDataService = tutorialContentDataService;
 }
コード例 #4
0
 public TutorialService(
     ITutorialContentDataService tutorialContentDataService,
     IProgressDataService progressDataService
     )
 {
     this.tutorialContentDataService = tutorialContentDataService;
     this.progressDataService        = progressDataService;
 }
コード例 #5
0
        public void Setup()
        {
            sectionContentDataService  = A.Fake <ISectionContentDataService>();
            tutorialContentDataService = A.Fake <ITutorialContentDataService>();

            sectionService = new SectionService(
                sectionContentDataService,
                tutorialContentDataService
                );
        }
コード例 #6
0
        public void Setup()
        {
            progressDataService        = A.Fake <IProgressDataService>();
            tutorialContentDataService = A.Fake <ITutorialContentDataService>();

            tutorialService = new TutorialService(
                tutorialContentDataService,
                progressDataService
                );
        }
コード例 #7
0
        public void SetUp()
        {
            var logger = A.Fake <ILogger <LearningMenuController> >();

            config                          = A.Fake <IConfiguration>();
            configService                   = A.Fake <IConfigService>();
            courseContentService            = A.Fake <ICourseContentService>();
            tutorialContentDataService      = A.Fake <ITutorialContentDataService>();
            sessionService                  = A.Fake <ISessionService>();
            sectionContentDataService       = A.Fake <ISectionContentDataService>();
            diagnosticAssessmentDataService = A.Fake <IDiagnosticAssessmentDataService>();
            diagnosticAssessmentService     = A.Fake <IDiagnosticAssessmentService>();
            postLearningAssessmentService   = A.Fake <IPostLearningAssessmentService>();
            courseCompletionService         = A.Fake <ICourseCompletionService>();

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

            httpContextSession = new MockHttpContextSession();

            controller = new LearningMenuController(
                logger,
                config,
                configService,
                courseContentService,
                sectionContentDataService,
                tutorialContentDataService,
                diagnosticAssessmentDataService,
                diagnosticAssessmentService,
                postLearningAssessmentService,
                sessionService,
                courseCompletionService
                )
            {
                ControllerContext = new ControllerContext
                {
                    HttpContext = new DefaultHttpContext
                    {
                        User    = user,
                        Session = httpContextSession
                    }
                }
            };
        }
コード例 #8
0
 public TrackerActionService(
     ITutorialContentDataService tutorialContentDataService,
     IClockService clockService,
     IProgressService progressService,
     IProgressDataService progressDataService,
     ISessionDataService sessionDataService,
     IStoreAspService storeAspService,
     ILogger <TrackerActionService> logger
     )
 {
     this.tutorialContentDataService = tutorialContentDataService;
     this.progressService            = progressService;
     this.progressDataService        = progressDataService;
     this.sessionDataService         = sessionDataService;
     this.storeAspService            = storeAspService;
     this.clockService = clockService;
     this.logger       = logger;
 }
コード例 #9
0
 public GroupsService(
     IGroupsDataService groupsDataService,
     IClockService clockService,
     ITutorialContentDataService tutorialContentDataService,
     IEmailService emailService,
     IJobGroupsDataService jobGroupsDataService,
     IProgressDataService progressDataService,
     IConfiguration configuration,
     ICentreCustomPromptsService centreCustomPromptsService
     )
 {
     this.groupsDataService          = groupsDataService;
     this.clockService               = clockService;
     this.tutorialContentDataService = tutorialContentDataService;
     this.emailService               = emailService;
     this.jobGroupsDataService       = jobGroupsDataService;
     this.progressDataService        = progressDataService;
     this.configuration              = configuration;
     this.centreCustomPromptsService = centreCustomPromptsService;
 }
コード例 #10
0
        public void Setup()
        {
            tutorialContentDataService = A.Fake <ITutorialContentDataService>();
            clockService        = A.Fake <IClockService>();
            progressService     = A.Fake <IProgressService>();
            progressDataService = A.Fake <IProgressDataService>();
            sessionDataService  = A.Fake <ISessionDataService>();
            storeAspService     = A.Fake <IStoreAspService>();
            logger = A.Fake <ILogger <TrackerActionService> >();

            A.CallTo(() => clockService.UtcNow).Returns(currentTime);

            trackerActionService = new TrackerActionService(
                tutorialContentDataService,
                clockService,
                progressService,
                progressDataService,
                sessionDataService,
                storeAspService,
                logger
                );
        }
コード例 #11
0
        public void SetUp()
        {
            var logger = A.Fake <ILogger <LearningMenuController> >();

            config                        = A.Fake <IConfiguration>();
            configDataService             = A.Fake <IConfigDataService>();
            courseContentService          = A.Fake <ICourseContentService>();
            tutorialContentDataService    = A.Fake <ITutorialContentDataService>();
            sessionService                = A.Fake <ISessionService>();
            sectionContentDataService     = A.Fake <ISectionContentDataService>();
            diagnosticAssessmentService   = A.Fake <IDiagnosticAssessmentService>();
            postLearningAssessmentService = A.Fake <IPostLearningAssessmentService>();
            courseCompletionService       = A.Fake <ICourseCompletionService>();
            clockService                  = A.Fake <IClockService>();

            controller = new LearningMenuController(
                logger,
                config,
                configDataService,
                courseContentService,
                sectionContentDataService,
                tutorialContentDataService,
                diagnosticAssessmentService,
                postLearningAssessmentService,
                sessionService,
                courseCompletionService,
                clockService
                ).WithDefaultContext()
                         .WithMockHttpContextSession()
                         .WithMockUser(true, CentreId, null, CandidateId, null)
                         .WithMockTempData()
                         .WithMockServices();

            authenticationService =
                (IAuthenticationService)controller.HttpContext.RequestServices.GetService(
                    typeof(IAuthenticationService)
                    );
            httpContextSession = controller.HttpContext.Session;
        }
コード例 #12
0
 public GroupsService(
     IGroupsDataService groupsDataService,
     IClockService clockService,
     ITutorialContentDataService tutorialContentDataService,
     IEmailService emailService,
     IJobGroupsDataService jobGroupsDataService,
     IProgressDataService progressDataService,
     IConfiguration configuration,
     ICentreRegistrationPromptsService centreRegistrationPromptsService,
     ILogger <IGroupsService> logger
     )
 {
     this.groupsDataService                = groupsDataService;
     this.clockService                     = clockService;
     this.tutorialContentDataService       = tutorialContentDataService;
     this.emailService                     = emailService;
     this.jobGroupsDataService             = jobGroupsDataService;
     this.progressDataService              = progressDataService;
     this.configuration                    = configuration;
     this.centreRegistrationPromptsService = centreRegistrationPromptsService;
     this.logger = logger;
 }
コード例 #13
0
        public void Setup()
        {
            groupsDataService          = A.Fake <IGroupsDataService>();
            clockService               = A.Fake <IClockService>();
            tutorialContentDataService = A.Fake <ITutorialContentDataService>();
            emailService               = A.Fake <IEmailService>();
            jobGroupsDataService       = A.Fake <IJobGroupsDataService>();
            progressDataService        = A.Fake <IProgressDataService>();
            configuration              = A.Fake <IConfiguration>();
            centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>();

            A.CallTo(() => configuration[ConfigHelper.AppRootPathName]).Returns("baseUrl");
            DatabaseModificationsDoNothing();
            groupsService = new GroupsService(
                groupsDataService,
                clockService,
                tutorialContentDataService,
                emailService,
                jobGroupsDataService,
                progressDataService,
                configuration,
                centreCustomPromptsService
                );
        }
コード例 #14
0
        public void Setup()
        {
            dataService = A.Fake <ITutorialContentDataService>();

            trackerActionService = new TrackerActionService(dataService);
        }
コード例 #15
0
 public TrackerActionService(ITutorialContentDataService tutorialContentDataService)
 {
     this.tutorialContentDataService = tutorialContentDataService;
 }