Пример #1
0
 public void MailServiceWasCalled()
 {
     MockedMailService.AssertWasCalled(n => n.SendMail(
                                           Arg.Is(Badge.Owner.EmailAddresses[0]),
                                           Arg <string> .Is.Anything,
                                           Arg <string> .Matches(x => x.Contains(Badge.Owner.FirstName)), // + " " + Badge.Owner.LastName + " your badge number:" + Badge.Nbr + " " + Badge.Owner.RegistrationDate.ToString("dd/MM/yyyy"),
                                           Arg <string> .Is.Anything));
 }
Пример #2
0
 public void ShouldSendMailToOwner()
 {
     foreach (var email in this.Declaration.RetrivedBadge.Owner.EmailAddresses)
     {
         MockedMailService.AssertWasCalled(n => n.SendMail(
                                               Arg.Is(email.Value),
                                               Arg.Is(this.Resources["owner_mail_from"]),
                                               Arg <string> .Matches(x => x.Contains(this.Declaration.Message)),
                                               Arg <string> .Is.Anything
                                               ));
     }
 }
Пример #3
0
 public void ShouldSendMailToAdmin()
 {
     MockedMailService.AssertWasCalled(n => n.SendMail(
                                           Arg.Is(this.Resources["admin_mail_to"]),
                                           Arg.Is(this.Resources["admin_mail_from"]),
                                           Arg <string> .Matches(
                                               x => x.Contains(this.Badge.Owner.LastName) &&
                                               x.Contains(this.Badge.Owner.FirstName) &&
                                               x.Contains(this.Badge.Owner.Mobiles[0]) &&
                                               x.Contains(this.Badge.Owner.EmailAddresses[0]) &&
                                               x.Contains(this.Declaration.RetrivedBadge.Nbr) &&
                                               x.Contains(this.Declaration.Id.ToString()) &&
                                               x.Contains(this.Declaration.LastName) &&
                                               x.Contains(this.Declaration.Message) &&
                                               x.Contains(this.Declaration.PhoneNumber)
                                               ),
                                           Arg <string> .Is.Anything));
 }