예제 #1
0
        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();
        }
예제 #2
0
 public RegistrationPromptsController(
     ICentreCustomPromptsService centreCustomPromptsService,
     IUserDataService userDataService
     )
 {
     this.centreCustomPromptsService = centreCustomPromptsService;
     this.userDataService            = userDataService;
 }
예제 #3
0
 public void Setup()
 {
     centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>();
     userService              = A.Fake <IUserService>();
     imageResizeService       = A.Fake <ImageResizeService>();
     jobGroupsDataService     = A.Fake <IJobGroupsDataService>();
     centreCustomPromptHelper = new CentreCustomPromptHelper(centreCustomPromptsService);
 }
예제 #4
0
        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);
        }
예제 #5
0
 public void Setup()
 {
     centreCustomPromptsDataService = A.Fake <ICentreCustomPromptsDataService>();
     logger                     = A.Fake <ILogger <CentreCustomPromptsService> >();
     userDataService            = A.Fake <IUserDataService>();
     centreCustomPromptsService = new CentreCustomPromptsService(
         centreCustomPromptsDataService,
         logger,
         userDataService
         );
 }
예제 #6
0
 public DelegateGroupsController(
     ICentreCustomPromptsService centreCustomPromptsService,
     IGroupsService groupsService,
     IUserService userService,
     ICourseService courseService
     )
 {
     this.centreCustomPromptsService = centreCustomPromptsService;
     this.groupsService = groupsService;
     this.userService   = userService;
     this.courseService = courseService;
 }
예제 #7
0
 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;
 }
예제 #8
0
 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;
 }
예제 #9
0
 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
         );
 }
예제 #10
0
 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;
 }
예제 #11
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;
 }
예제 #12
0
        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();
        }
예제 #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()
 {
     centreCustomPromptsService = A.Fake <ICentreCustomPromptsService>();
     centreCustomPromptHelper   = new CentreCustomPromptHelper(centreCustomPromptsService);
 }
예제 #15
0
 public CentreCustomPromptHelper(ICentreCustomPromptsService customPromptsService)
 {
     centreCustomPromptsService = customPromptsService;
 }
예제 #16
0
        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);
        }