public PersonalRiskAssessmentCurrentTabActionFilter(PersonalRiskAssessmentTabs personalRiskAssessmentTabs,
                                                     IEmployeeChecklistGeneratorViewModelFactory
                                                         checklistGeneratorViewModelFactory)
 {
     _personalRiskAssessmentTabs = personalRiskAssessmentTabs;
     _checklistGeneratorViewModelFactory = checklistGeneratorViewModelFactory;
 }
 public ChecklistGeneratorController(IEmployeeChecklistGeneratorViewModelFactory checklistGeneratorViewModelFactory,
                                     IEmployeeService employeeService,
                                     IPersonalRiskAssessmentService personalRiskAssessmentService,
                                     ISelectedEmployeeViewModelFactory selectedEmployeeViewModelFactory,
                                     IBus bus,
                                     IBusinessSafeSessionManager businessSafeSessionManager)
 {
     _checklistGeneratorViewModelFactory = checklistGeneratorViewModelFactory;
     _employeeService = employeeService;
     _personalRiskAssessmentService = personalRiskAssessmentService;
     _selectedEmployeeViewModelFactory = selectedEmployeeViewModelFactory;
     _bus = bus;
     _businessSafeSessionManager = businessSafeSessionManager;
 }
示例#3
0
        public void Setup()
        {
            _employeeService = new Mock<IEmployeeService>();
            _employeeChecklistEmailService = new Mock<IEmployeeChecklistEmailService>();
            _personalRiskAssessmentService = new Mock<IPersonalRiskAssessmentService>();
            _checklistService = new Mock<IChecklistService>();
            _siteService = new Mock<ISiteService>();
            _businessSafeSessionManager=new Mock<IBusinessSafeSessionManager>();
            _bus = new Mock<IBus>();
            _selectedEmployeeViewModelFactory = new SelectedEmployeeViewModelFactory(_personalRiskAssessmentService.Object);
            _checklistGeneratorViewModelFactory = new EmployeeChecklistGeneratorViewModelFactory(_employeeService.Object, _checklistService.Object, _personalRiskAssessmentService.Object, _siteService.Object, _selectedEmployeeViewModelFactory);
            _companyId = 23522L;
            _riskAssessmentId = 342L;
            _message = "Test Message";

            _employees = new List<EmployeeDto>
                             {
                                 new EmployeeDto
                                     {
                                         Id = _currentUserId,
                                         FullName = "Mark Mauve",
                                         MainContactDetails = new EmployeeContactDetailDto{ Email = "*****@*****.**"}
                                     },
                                 new EmployeeDto
                                     {
                                         Id = new Guid("cf7ce0b2-8a97-4c32-8af1-ce3c96716fdd"),
                                         FullName = "Peter Pink"
                                     },
                                 new EmployeeDto
                                     {
                                         Id = new Guid("0b20512d-3b4e-4da3-ab8c-6433c3fa4118"),
                                         FullName = "Guy Grey",
                                         MainContactDetails = new EmployeeContactDetailDto{ Email = "*****@*****.**"}
                                     }
                             };

            _checklists = new List<ChecklistDto>
                              {
                                  new ChecklistDto
                                      {
                                          Id = 1L,
                                          Title = "Test Checklist 01"
                                      },
                                  new ChecklistDto
                                      {
                                          Id = 2L,
                                          Title = "Test Checklist 02"
                                      },
                                  new ChecklistDto
                                      {
                                          Id = 3L,
                                          Title = "Test Checklist 03"
                                      },
                              };

            _basePersonalRiskAssessment = new PersonalRiskAssessmentDto
                                              {
                                                  Id = _riskAssessmentId,
                                                  ChecklistGeneratorEmployees = new EmployeeDto[0],
                                                  Checklists = new ChecklistDto[0],
                                                  ChecklistGeneratorMessage = _message
                                              };

            _target = GetTarget();
            _currentUserId = _target.CurrentUser.UserId;

            _employeeService
                .Setup(x => x.GetAll(_companyId))
                .Returns(_employees);

            _checklistService
                .Setup(x => x.GetByRiskAssessmentType(ChecklistRiskAssessmentType.Personal))
                .Returns(_checklists);

            _siteService
                .Setup(x => x.GetAll(_companyId))
                .Returns(new List<SiteDto>());
        }
 public PersonalRiskAssessmentCurrentTabActionFilter(PersonalRiskAssessmentTabs personalRiskAssessmentTabs)
 {
     _personalRiskAssessmentTabs = personalRiskAssessmentTabs;
     _checklistGeneratorViewModelFactory =
         ObjectFactory.GetInstance<IEmployeeChecklistGeneratorViewModelFactory>();
 }