public JsonResult MarkRiskAssessmentIsDraftStatus(MarkRiskAssessmentIsDraftStatusViewModel viewModel)
        {
            if (viewModel.IsDraft)
            {
                _riskAssessmentService.MarkRiskAssessmentAsDraft(new MarkRiskAssessmentAsDraftRequest()
                                                                     {
                                                                         CompanyId = viewModel.CompanyId,
                                                                         RiskAssessmentId = viewModel.RiskAssessmentId,
                                                                         UserId = CurrentUser.UserId
                                                                     });
            }
            else
            {
                var canMarkRiskAssessmentAsLive = _riskAssessmentService.CanMarkRiskAssessmentAsLive(viewModel.CompanyId, viewModel.RiskAssessmentId);

                if (canMarkRiskAssessmentAsLive)
                {
                    _riskAssessmentService.MarkRiskAssessmentAsLive(new MarkRiskAssessmentAsLiveRequest()
                    {
                        CompanyId = viewModel.CompanyId,
                        RiskAssessmentId = viewModel.RiskAssessmentId,
                        UserId = CurrentUser.UserId
                    });
                }
                else
                {
                    return Json(new { Success = false, Message = "Please set a Review Date." });
                }
            }

            return Json(new { Success = true });
        }
        public void Given_valid_request_to_mark_as_draft_When_mark_risk_assessment_is_draft_status_Then_should_call_correct_methods()
        {
            // Given
            var controller = GetTarget();
            var request = new MarkRiskAssessmentIsDraftStatusViewModel()
                              {
                                  CompanyId = CompanyId,
                                  RiskAssessmentId = RiskAssessmentId,
                                  IsDraft = true
                              };

            // When
            controller.MarkRiskAssessmentIsDraftStatus(request);

            // Then
            _riskAssessmentService.Verify(x => x.MarkRiskAssessmentAsDraft(It.Is<MarkRiskAssessmentAsDraftRequest>(y => y.CompanyId == request.CompanyId && y.RiskAssessmentId == request.RiskAssessmentId && y.UserId == controller.CurrentUser.UserId)));
        }
        public void Given_valid_request_to_mark_not_as_draft_When_mark_risk_assessment_is_draft_status_and_cannot_be_marked_as_not_draft_Then_should_call_correct_methods()
        {
            // Given
            var controller = GetTarget();
            var request = new MarkRiskAssessmentIsDraftStatusViewModel()
            {
                CompanyId = CompanyId,
                RiskAssessmentId = RiskAssessmentId,
                IsDraft = false
            };

            _riskAssessmentService.Setup(x => x.CanMarkRiskAssessmentAsLive(It.IsAny<long>(), It.IsAny<long>()))
                .Returns(false);
            // When
            controller.MarkRiskAssessmentIsDraftStatus(request);

            // Then
            _riskAssessmentService.Verify(x => x.MarkRiskAssessmentAsLive(It.Is<MarkRiskAssessmentAsLiveRequest>(y => y.CompanyId == request.CompanyId && y.RiskAssessmentId == request.RiskAssessmentId && y.UserId == controller.CurrentUser.UserId)),Times.Never());

        }