Пример #1
0
            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!"));
            }
Пример #2
0
            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!"));
            }
Пример #3
0
            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!"));
            }