public async void AddRecipient_ToNotExistingEmail_NotExistsResult() { var handler = new AddRecipientCommandHandler(this, this); await handler.Handle(new AddRecipientCommand("100", new List <EmailAddressDto> { new EmailAddressDto() { Address = "*****@*****.**", Name = "A" } }), new System.Threading.CancellationToken()); Assert.Equal(EmailResult.NotExists, testResult); }
public async void AddRecipient_NewFromEmail_SuccessResult() { var handler = new AddRecipientCommandHandler(this, this); CreateNew("Subject", "Author", "Body"); testToEmails.Add("*****@*****.**"); await handler.Handle(new AddRecipientCommand("1", new List <EmailAddressDto> { new EmailAddressDto() { Address = "*****@*****.**", Name = "A" } }), new System.Threading.CancellationToken()); Assert.Equal(EmailResult.Success, testResult); Assert.Equal(2, testToEmails.Count); Assert.Contains(testToEmails, x => x == "*****@*****.**"); }
public async void AddRecipient_EmailThatAleardyExists_AlreadyExistsResult() { var handler = new AddRecipientCommandHandler(this, this); CreateNew("Subject", "Author", "Body"); testToEmails = new List <string> { "*****@*****.**", "*****@*****.**" }; await handler.Handle(new AddRecipientCommand("1", new List <EmailAddressDto> { new EmailAddressDto() { Address = "*****@*****.**", Name = "A" } }), new System.Threading.CancellationToken()); Assert.Equal(EmailResult.AlreadyExists, testResult); }