build tests
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
using isnd.tests;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
@ -8,13 +9,13 @@ namespace yavscTests
|
||||
|
||||
[Collection("EMaillingTeststCollection")]
|
||||
[Trait("regression", "II")]
|
||||
public class EMaillingTests : IClassFixture<ServerSideFixture>
|
||||
public class EMaillingTests : IClassFixture<WebServerFixture>
|
||||
|
||||
{
|
||||
readonly ServerSideFixture _serverFixture;
|
||||
readonly WebServerFixture _serverFixture;
|
||||
readonly ITestOutputHelper output;
|
||||
readonly ILogger _logger;
|
||||
public EMaillingTests(ServerSideFixture serverFixture, ITestOutputHelper output)
|
||||
public EMaillingTests(WebServerFixture serverFixture, ITestOutputHelper output)
|
||||
{
|
||||
this.output = output;
|
||||
_serverFixture = serverFixture;
|
||||
@ -25,20 +26,13 @@ namespace yavscTests
|
||||
public void SendEMailSynchrone()
|
||||
{
|
||||
|
||||
AssertAsync.CompletesIn(2, () =>
|
||||
{
|
||||
output.WriteLine("SendEMailSynchrone ...");
|
||||
EmailSentViewModel mailSentInfo = _serverFixture.MailSender.SendEmailAsync
|
||||
(_serverFixture.SiteSetup.Owner.Name, _serverFixture.SiteSetup.Owner.EMail, $"monthly email", "test boby monthly email").Result;
|
||||
if (mailSentInfo==null)
|
||||
_logger.LogError("No info on sending");
|
||||
else if (!mailSentInfo.Sent)
|
||||
_logger.LogError($"{mailSentInfo.ErrorMessage}");
|
||||
else
|
||||
_logger.LogInformation($"mailId:{mailSentInfo.MessageId} \nto:{_serverFixture.SiteSetup.Owner.Name}");
|
||||
Assert.NotNull(mailSentInfo);
|
||||
output.WriteLine($">>done with {mailSentInfo.EMail} {mailSentInfo.Sent} {mailSentInfo.MessageId} {mailSentInfo.ErrorMessage}");
|
||||
});
|
||||
}
|
||||
AssertAsync.CompletesIn(2, () =>
|
||||
{
|
||||
output.WriteLine("SendEMailSynchrone ...");
|
||||
_serverFixture.MailSender.SendEmailAsync
|
||||
(_serverFixture.SiteSettings.Owner.EMail, $"monthly email", "test boby monthly email").Wait();
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user