public async Task NotifyAsync_ReturnSuccess() { // Arrange var to = _faker.Internet.Email(); _emailMessage.To.Add(to); // Act var result = await _notificator.NotifyAsync(_emailMessage); // Assert _output.WriteLine(result.ToString()); Assert.True(result.Success); }
public async Task NotifyAsync_ConfigHas3SmtpServersAndFirstOfThemDoesNotWork_SmtpClient1WasReceived() { // Arrange _smtpClient1.SendAsync(Arg.Any <MailMessage>()).Throws(new Exception()); // Act await _notificator.NotifyAsync(_emailMessage); // Assert await _smtpClient1.Received(1).SendAsync(Arg.Any <MailMessage>()); }