public void Setup() { centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>(); groupsService = A.Fake <IGroupsService>(); userService = A.Fake <IUserService>(); courseService = A.Fake <ICourseService>(); A.CallTo(() => groupsService.GetGroupsForCentre(A <int> ._)).Returns(new List <Group>()); A.CallTo(() => centreCustomPromptsService.GetCustomPromptsForCentreByCentreId(A <int> ._)) .Returns(prompts); httpRequest = A.Fake <HttpRequest>(); httpResponse = A.Fake <HttpResponse>(); const string cookieName = "DelegateGroupsFilter"; const string cookieValue = "LinkedToField|LinkedToField|0"; delegateGroupsController = new DelegateGroupsController( centreCustomPromptsService, groupsService, userService, courseService ) .WithMockHttpContext(httpRequest, cookieName, cookieValue, httpResponse) .WithMockUser(true) .WithMockServices() .WithMockTempData(); }
public RegistrationPromptsController( ICentreCustomPromptsService centreCustomPromptsService, IUserDataService userDataService ) { this.centreCustomPromptsService = centreCustomPromptsService; this.userDataService = userDataService; }
public void Setup() { centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>(); userService = A.Fake <IUserService>(); imageResizeService = A.Fake <ImageResizeService>(); jobGroupsDataService = A.Fake <IJobGroupsDataService>(); centreCustomPromptHelper = new CentreCustomPromptHelper(centreCustomPromptsService); }
public void SetUp() { jobGroupsDataService = A.Fake <IJobGroupsDataService>(); centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>(); A.CallTo(() => jobGroupsDataService.GetJobGroupName(1)).Returns(OldJobGroupName); A.CallTo(() => jobGroupsDataService.GetJobGroupName(2)).Returns(NewJobGroupName); }
public void Setup() { centreCustomPromptsDataService = A.Fake <ICentreCustomPromptsDataService>(); logger = A.Fake <ILogger <CentreCustomPromptsService> >(); userDataService = A.Fake <IUserDataService>(); centreCustomPromptsService = new CentreCustomPromptsService( centreCustomPromptsDataService, logger, userDataService ); }
public DelegateGroupsController( ICentreCustomPromptsService centreCustomPromptsService, IGroupsService groupsService, IUserService userService, ICourseService courseService ) { this.centreCustomPromptsService = centreCustomPromptsService; this.groupsService = groupsService; this.userService = userService; this.courseService = courseService; }
public MyAccountController( ICentreCustomPromptsService centreCustomPromptsService, IUserService userService, IImageResizeService imageResizeService, IJobGroupsDataService jobGroupsDataService, CentreCustomPromptHelper customPromptHelper ) { this.centreCustomPromptsService = centreCustomPromptsService; this.userService = userService; this.imageResizeService = imageResizeService; this.jobGroupsDataService = jobGroupsDataService; centreCustomPromptHelper = customPromptHelper; }
public DelegateApprovalsService( IUserDataService userDataService, ICentreCustomPromptsService centreCustomPromptsService, IEmailService emailService, ICentresDataService centresDataService, ILogger <DelegateApprovalsService> logger, IConfiguration config ) { this.userDataService = userDataService; this.centreCustomPromptsService = centreCustomPromptsService; this.emailService = emailService; this.centresDataService = centresDataService; this.logger = logger; this.config = config; }
public void SetUp() { userDataService = A.Fake <IUserDataService>(); centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>(); emailService = A.Fake <IEmailService>(); centresDataService = A.Fake <ICentresDataService>(); logger = A.Fake <ILogger <DelegateApprovalsService> >(); config = A.Fake <IConfiguration>(); delegateApprovalsService = new DelegateApprovalsService( userDataService, centreCustomPromptsService, emailService, centresDataService, logger, config ); }
public SupervisorController( ISupervisorService supervisorService, ICommonService commonService, IFrameworkNotificationService frameworkNotificationService, ISelfAssessmentService selfAssessmentService, IConfigService configService, ICentreCustomPromptsService centreCustomPromptsService, ILogger <SupervisorController> logger, IConfiguration config) { this.supervisorService = supervisorService; this.commonService = commonService; this.frameworkNotificationService = frameworkNotificationService; this.selfAssessmentService = selfAssessmentService; this.configService = configService; this.centreCustomPromptsService = centreCustomPromptsService; this.logger = logger; this.config = config; }
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; }
public void Setup() { centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>(); userDataService = A.Fake <IUserDataService>(); registrationPromptsController = new RegistrationPromptsController(centreCustomPromptsService, userDataService) .WithDefaultContext() .WithMockUser(true) .WithMockTempData(); httpRequest = A.Fake <HttpRequest>(); const string cookieName = "AddRegistrationPromptData"; const string cookieValue = "AddRegistrationPromptData"; registrationPromptsControllerWithMockHttpContext = new RegistrationPromptsController(centreCustomPromptsService, userDataService) .WithMockHttpContext(httpRequest, cookieName, cookieValue) .WithMockUser(true) .WithMockTempData(); }
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 ); }
public void Setup() { centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>(); centreCustomPromptHelper = new CentreCustomPromptHelper(centreCustomPromptsService); }
public CentreCustomPromptHelper(ICentreCustomPromptsService customPromptsService) { centreCustomPromptsService = customPromptsService; }
public static List <LinkedFieldChange> GetLinkedFieldChanges( CentreAnswersData oldAnswers, CentreAnswersData newAnswers, IJobGroupsDataService jobGroupsDataService, ICentreCustomPromptsService centreCustomPromptsService ) { var changedLinkedFieldsWithAnswers = new List <LinkedFieldChange>(); if (newAnswers.Answer1 != oldAnswers.Answer1) { var prompt1Name = centreCustomPromptsService.GetPromptNameForCentreAndPromptNumber(oldAnswers.CentreId, 1); changedLinkedFieldsWithAnswers.Add( new LinkedFieldChange(1, prompt1Name, oldAnswers.Answer1, newAnswers.Answer1) ); } if (newAnswers.Answer2 != oldAnswers.Answer2) { var prompt2Name = centreCustomPromptsService.GetPromptNameForCentreAndPromptNumber(oldAnswers.CentreId, 2); changedLinkedFieldsWithAnswers.Add( new LinkedFieldChange(2, prompt2Name, oldAnswers.Answer2, newAnswers.Answer2) ); } if (newAnswers.Answer3 != oldAnswers.Answer3) { var prompt3Name = centreCustomPromptsService.GetPromptNameForCentreAndPromptNumber(oldAnswers.CentreId, 3); changedLinkedFieldsWithAnswers.Add( new LinkedFieldChange(3, prompt3Name, oldAnswers.Answer3, newAnswers.Answer3) ); } if (newAnswers.JobGroupId != oldAnswers.JobGroupId) { var oldJobGroup = jobGroupsDataService.GetJobGroupName(oldAnswers.JobGroupId); var newJobGroup = jobGroupsDataService.GetJobGroupName(newAnswers.JobGroupId); changedLinkedFieldsWithAnswers.Add(new LinkedFieldChange(4, "Job Group", oldJobGroup, newJobGroup)); } if (newAnswers.Answer4 != oldAnswers.Answer4) { var prompt4Name = centreCustomPromptsService.GetPromptNameForCentreAndPromptNumber(oldAnswers.CentreId, 4); changedLinkedFieldsWithAnswers.Add( new LinkedFieldChange(5, prompt4Name, oldAnswers.Answer4, newAnswers.Answer4) ); } if (newAnswers.Answer5 != oldAnswers.Answer5) { var prompt5Name = centreCustomPromptsService.GetPromptNameForCentreAndPromptNumber(oldAnswers.CentreId, 5); changedLinkedFieldsWithAnswers.Add( new LinkedFieldChange(6, prompt5Name, oldAnswers.Answer5, newAnswers.Answer5) ); } if (newAnswers.Answer6 != oldAnswers.Answer6) { var prompt6Name = centreCustomPromptsService.GetPromptNameForCentreAndPromptNumber(oldAnswers.CentreId, 6); changedLinkedFieldsWithAnswers.Add( new LinkedFieldChange(7, prompt6Name, oldAnswers.Answer6, newAnswers.Answer6) ); } return(changedLinkedFieldsWithAnswers); }