public async void UsesTheDeliveryMethodSpecifiedInConfigurationWhenTheDefaultDeliveryMethodIsSpecified() { string mailData; using (var server = LocalMailServer.StartNew(7777)) // port 7777 defined in app.config { await _mailMessage.SendAsync(DeliveryMethod.Default); mailData = await server.GetMailDataAsync(); } Assert.That(mailData.Contains("Hello, World!")); }
public async void UsesTheNetworkDeliveryMethodWhenSpecified() { string mailData; using (var server = LocalMailServer.StartNew(7778)) { await _mailMessage.SendAsync(DeliveryMethod.Network("localhost", 7778)); mailData = await server.GetMailDataAsync(); } Assert.That(mailData.Contains("Hello, World!")); }
public void UsesTheDeliveryMethodSpecifiedInConfigurationWhenNoDeliveryMethodParameterIsSpecified() { string mailData; using (var server = LocalMailServer.StartNew(7777)) // port 7777 defined in app.config { _mailMessage.SendAsync().Wait(); mailData = server.GetMailData().Result; } Assert.That(mailData.Contains("Hello, World!")); }