public void When_ResendEmployeeChecklist_Then_should_call_correct_methods()
        {
            // Given
            var target = GetTarget();

            var viewModel = new ResendEmployeeChecklistViewModel()
                                {
                                    RiskAssessmentId = 200,
                                    EmployeeChecklistId = Guid.NewGuid()
                                };

            var userId = target.CurrentUser.UserId;

            // When
            target.ResendEmployeeChecklist(viewModel);
            

            // Then
            _bus.Verify(
                x =>
                x.Send(
                    It.Is<ResendEmployeeChecklistEmail>(
                        y =>
                        y.EmployeeChecklistId == viewModel.EmployeeChecklistId &&
                        y.RiskAssessmentId == viewModel.RiskAssessmentId && y.ResendUserId == userId)));
        }
        public void When_ResendEmployeeChecklist_Then_should_return_correct_result()
        {
            // Given
            var target = GetTarget();

            var viewModel = new ResendEmployeeChecklistViewModel()
            {
                RiskAssessmentId = 200,
                EmployeeChecklistId = Guid.NewGuid()
            };

            var userId = target.CurrentUser.UserId;

            // When
            var result = target.ResendEmployeeChecklist(viewModel) as JsonResult;


            // Then
            Assert.That(result.Data.ToString(), Is.EqualTo("{ Success = True }"));
        }
 public JsonResult ResendEmployeeChecklist(ResendEmployeeChecklistViewModel viewModel)
 {
     _bus.Send(new ResendEmployeeChecklistEmail
                  {
                      EmployeeChecklistId = viewModel.EmployeeChecklistId,
                      ResendUserId = CurrentUser.UserId,
                      RiskAssessmentId = viewModel.RiskAssessmentId
                  });
     return Json(new { Success = true });
 }