reorg
This commit is contained in:
parent
fb1edf8b8e
commit
d12667d6de
11 changed files with 53 additions and 36 deletions
44
src/test/NonRegression/EMailling.cs
Normal file
44
src/test/NonRegression/EMailling.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using Microsoft.Extensions.Logging;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using Yavsc.Abstract.Manage;
|
||||
|
||||
namespace test
|
||||
{
|
||||
|
||||
[Collection("EMaillingTeststCollection")]
|
||||
[Trait("regression", "non")]
|
||||
public class EMaillingTests : IClassFixture<ServerSideFixture>
|
||||
|
||||
{
|
||||
readonly ServerSideFixture _serverFixture;
|
||||
readonly ITestOutputHelper output;
|
||||
readonly ILogger _logger;
|
||||
public EMaillingTests(ServerSideFixture serverFixture, ITestOutputHelper output)
|
||||
{
|
||||
this.output = output;
|
||||
_serverFixture = serverFixture;
|
||||
_logger = serverFixture.Logger;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
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}");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue