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; }
public void Setup() { var connection = ServiceTestHelper.GetDatabaseConnection(); var logger = A.Fake <ILogger <DiagnosticAssessmentService> >(); diagnosticAssessmentDataService = A.Fake <IDiagnosticAssessmentDataService>(); diagnosticAssessmentService = new DiagnosticAssessmentService(connection, logger, diagnosticAssessmentDataService); diagnosticAssessmentTestHelper = new DiagnosticAssessmentTestHelper(connection); }
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 } } }; }
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; }