public void Setup() { _viewModel = new FireRiskAssessmentChecklistViewModel { CompanyId = 41212L, FireRiskAssessmentChecklistId = 121L, RiskAssessmentId = 142L, Sections = new List<SectionViewModel> { new SectionViewModel { Questions = new List<QuestionViewModel> { new QuestionViewModel { Id = 80L, Answer = new FireAnswerViewModel { YesNoNotApplicableResponse = YesNoNotApplicableEnum.Yes, AdditionalInfo = "Test Additional Info 1" } }, new QuestionViewModel { Id = 81L, Answer = new FireAnswerViewModel { YesNoNotApplicableResponse = YesNoNotApplicableEnum.No } }, new QuestionViewModel { Id = 82L, Answer = new FireAnswerViewModel { YesNoNotApplicableResponse = YesNoNotApplicableEnum.NotApplicable } }, new QuestionViewModel { Id = 83L, Answer = new FireAnswerViewModel { YesNoNotApplicableResponse = null } }, } } } }; _fireRiskAssessmentService = new Mock<IFireRiskAssessmentService>(); _fireRiskAssessmentChecklistService = new Mock<IFireRiskAssessmentChecklistService>(); _fireRiskAssessmentChecklistViewModelFactory = new FireRiskAssessmentChecklistViewModelFactory(_fireRiskAssessmentService.Object, null); _controller = new ChecklistController( _fireRiskAssessmentChecklistViewModelFactory, _fireRiskAssessmentChecklistService.Object, null, null ); _controller = TestControllerHelpers.AddUserToController(_controller); _controller.SaveChecklistOnlyForAuditing(_viewModel); }
private ChecklistController GetTarget() { var controller = new ChecklistController( null, _fireRiskAssessmentChecklistService.Object, null, null ); return TestControllerHelpers.AddUserToController(controller); }
private ChecklistController GetTarget() { var target = new ChecklistController( null, null, null, _fireRiskAssessmentFurtherControlMeasureTaskService.Object ); return TestControllerHelpers.AddUserToController(target); }
private ChecklistController GetTarget() { var target = new ChecklistController( _fireRiskAssessmentChecklistViewModelFactory, _fireRiskAssessmentChecklistService.Object, null, null); return TestControllerHelpers.AddUserToController(target); }