yavsc/test/yavscTests/NonRegression/EMailling.cs

49 lines
1.5 KiB
C#

5 months ago
using isnd.tests;
5 months ago
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Xunit;
using Xunit.Abstractions;
using Yavsc.Abstract.Manage;
5 months ago
using Yavsc.Interface;
using Yavsc.Models;
5 years ago
namespace yavscTests
{
[Collection("EMaillingTeststCollection")]
5 years ago
[Trait("regression", "II")]
5 months ago
public class EMaillingTests : IClassFixture<WebServerFixture>
{
5 months ago
readonly WebServerFixture _serverFixture;
readonly ITestOutputHelper output;
readonly ILogger _logger;
5 months ago
public EMaillingTests(WebServerFixture serverFixture, ITestOutputHelper output)
{
this.output = output;
_serverFixture = serverFixture;
7 years ago
_logger = serverFixture.Logger;
}
[Fact]
public void SendEMailSynchrone()
{
5 months ago
AssertAsync.CompletesIn(2, () =>
5 months ago
{
5 months ago
using IServiceScope scope = _serverFixture.Services.CreateScope();
ITrueEmailSender mailSender = scope.ServiceProvider.GetRequiredService<ITrueEmailSender>();
5 months ago
output.WriteLine("SendEMailSynchrone ...");
5 months ago
mailSender.SendEmailAsync
(
_serverFixture.SiteSettings.Owner.Name,
_serverFixture.SiteSettings.Owner.EMail,
$"monthly email",
"test boby monthly email").Wait();
5 months ago
});
}
}
7 years ago
}