|
|
|
@ -16,7 +16,7 @@ using Microsoft.Data.Entity.Metadata.Conventions;
|
|
|
|
|
|
|
|
|
|
|
|
namespace test
|
|
|
|
namespace test
|
|
|
|
{
|
|
|
|
{
|
|
|
|
[Trait("regres", "no")]
|
|
|
|
[Trait("regression", "II")]
|
|
|
|
public class ServerSideFixture : IDisposable
|
|
|
|
public class ServerSideFixture : IDisposable
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SiteSettings _siteSetup;
|
|
|
|
SiteSettings _siteSetup;
|
|
|
|
@ -99,11 +99,17 @@ namespace test
|
|
|
|
private readonly IHostingEngine hostengnine;
|
|
|
|
private readonly IHostingEngine hostengnine;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AssertNotNull(object obj, string msg)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (obj == null)
|
|
|
|
|
|
|
|
throw new Exception(msg);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
public ServerSideFixture()
|
|
|
|
public ServerSideFixture()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
host = new WebHostBuilder();
|
|
|
|
host = new WebHostBuilder();
|
|
|
|
|
|
|
|
AssertNotNull(host, nameof(host));
|
|
|
|
|
|
|
|
|
|
|
|
hostengnine = host
|
|
|
|
hostengnine = host
|
|
|
|
.UseEnvironment("Development")
|
|
|
|
.UseEnvironment("Development")
|
|
|
|
@ -111,15 +117,24 @@ namespace test
|
|
|
|
.UseStartup<test.Startup>()
|
|
|
|
.UseStartup<test.Startup>()
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AssertNotNull(hostengnine, nameof(hostengnine));
|
|
|
|
|
|
|
|
|
|
|
|
App = hostengnine.Start();
|
|
|
|
App = hostengnine.Start();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AssertNotNull(App, nameof(App));
|
|
|
|
|
|
|
|
|
|
|
|
// hostengnine.ApplicationServices
|
|
|
|
// hostengnine.ApplicationServices
|
|
|
|
|
|
|
|
|
|
|
|
_mailer = App.Services.GetService(typeof(EMailer)) as EMailer;
|
|
|
|
_mailer = App.Services.GetService(typeof(EMailer)) as EMailer;
|
|
|
|
|
|
|
|
AssertNotNull(_mailer, nameof(_mailer));
|
|
|
|
|
|
|
|
MailSender = App.Services.GetService(typeof(IEmailSender)) as IEmailSender;
|
|
|
|
|
|
|
|
AssertNotNull(MailSender, nameof(MailSender));
|
|
|
|
|
|
|
|
|
|
|
|
_loggerFactory = App.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
|
|
|
_loggerFactory = App.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
|
|
|
|
|
|
|
AssertNotNull(_loggerFactory, nameof(_loggerFactory));
|
|
|
|
var siteSetup = App.Services.GetService(typeof(IOptions<SiteSettings>)) as IOptions<SiteSettings>;
|
|
|
|
var siteSetup = App.Services.GetService(typeof(IOptions<SiteSettings>)) as IOptions<SiteSettings>;
|
|
|
|
|
|
|
|
AssertNotNull(siteSetup, nameof(siteSetup));
|
|
|
|
var testingSetup = App.Services.GetService(typeof(IOptions<Testing>)) as IOptions<Testing>;
|
|
|
|
var testingSetup = App.Services.GetService(typeof(IOptions<Testing>)) as IOptions<Testing>;
|
|
|
|
MailSender = App.Services.GetService(typeof(IEmailSender)) as IEmailSender;
|
|
|
|
|
|
|
|
DbContext = App.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
|
|
|
|
DbContext = App.Services.GetService(typeof(ApplicationDbContext)) as ApplicationDbContext;
|
|
|
|
|
|
|
|
|
|
|
|
SiteSetup = siteSetup.Value;
|
|
|
|
SiteSetup = siteSetup.Value;
|
|
|
|
|