public void Given_deleted_irns_When_handle_then_deleted_irns_should_not_be_added_to_email()
        {
            // Given
            var handler = GetTarget();
            var message = new SendIRNNotificationEmail();
            var checklist = new Checklist()
                                {
                                    Id = Guid.NewGuid(),
                                    EmailAddress = "*****@*****.**"
                                };
            checklist.AddImmediateRiskNotification(new ImmediateRiskNotification()
                                                       {
                                                           Id = Guid.NewGuid(),
                                                           RecommendedImmediateAction = "Test IRN action",
                                                           Deleted = false
                                                       });
            checklist.AddImmediateRiskNotification(new ImmediateRiskNotification()
                                                       {
                                                           Id = Guid.NewGuid(),
                                                           Deleted = true
                                                       });
            checklist.AddImmediateRiskNotification(new ImmediateRiskNotification()
                                                       {
                                                           Id = Guid.NewGuid(),
                                                           Deleted = true
                                                       });

            _checklistRepository.Setup(c => c.GetById(It.IsAny<Guid>()))
                .Returns(() => checklist);

            SendIRNNotificationEmailViewModel viewModelUsedToCreateEmail = null;
            handler.Protected()
                .Setup("CreateRazorEmailResult", ItExpr.IsAny<SendIRNNotificationEmailViewModel>())
                .Callback<SendIRNNotificationEmailViewModel>(viewModel => viewModelUsedToCreateEmail = viewModel);

            // When
            handler.Object.Handle(message);

            // Then
            Assert.That(viewModelUsedToCreateEmail.IRNList.Count, Is.EqualTo(1));
        }
        public void When_handle_then_Should_Call_Correct_Methods()
        {
            // Given
            var handler = GetTarget();
            var message = new SendIRNNotificationEmail();

            _checklistRepository.Setup(c => c.GetById(It.IsAny<Guid>()))
                .Returns(() =>
                             {
                                 var checklist = new Checklist()
                                                     {
                                                         Id = Guid.NewGuid(),
                                                         EmailAddress = "*****@*****.**",

                                                     };
                                 checklist.AddImmediateRiskNotification(new ImmediateRiskNotification()
                                                                            {
                                                                                Id = Guid.NewGuid(),
                                                                                RecommendedImmediateAction =
                                                                                    "Test IRN action",
                                                                                Deleted = false
                                                                            });

                                 return checklist;
                             }
                );

            // When
            handler.Object.Handle(message);


            // Then
            _emailSender.Verify(x => x.Send(It.IsAny<RazorEmailResult>()));
            handler.Protected().Verify("CreateRazorEmailResult", Times.Once(),
                                       ItExpr.IsAny<SendIRNNotificationEmailViewModel>());
        }