preparing to feed abstract
[FIXME] test won't end
This commit is contained in:
100
test/Startup.cs
Normal file
100
test/Startup.cs
Normal file
@ -0,0 +1,100 @@
|
||||
using System;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Yavsc;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Services;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.AspNet.Authentication;
|
||||
using Microsoft.Extensions.WebEncoders;
|
||||
using Yavsc.Lib;
|
||||
|
||||
namespace test
|
||||
{
|
||||
public class Startup
|
||||
{
|
||||
public string ConnectionString
|
||||
{
|
||||
get ; set;
|
||||
}
|
||||
|
||||
public static SiteSettings SiteSetup { get; private set; }
|
||||
public static SmtpSettings SmtpSettup { get; private set; }
|
||||
public static IConfiguration Configuration { get; set; }
|
||||
|
||||
public static string HostingFullName { get; private set; }
|
||||
|
||||
ILogger logger;
|
||||
public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv)
|
||||
{
|
||||
var devtag = env.IsDevelopment()?"D":"";
|
||||
var prodtag = env.IsProduction()?"P":"";
|
||||
var stagetag = env.IsStaging()?"S":"";
|
||||
|
||||
HostingFullName = $"{appEnv.RuntimeFramework.FullName} [{env.EnvironmentName}:{prodtag}{devtag}{stagetag}]";
|
||||
// Set up configuration sources.
|
||||
|
||||
var builder = new ConfigurationBuilder()
|
||||
.AddEnvironmentVariables()
|
||||
.AddJsonFile("appsettings.json")
|
||||
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);
|
||||
Configuration = builder.Build();
|
||||
ConnectionString = Configuration["Data:DefaultConnection:ConnectionString"];
|
||||
AppDomain.CurrentDomain.SetData("YAVSC_CONNECTION", ConnectionString);
|
||||
}
|
||||
|
||||
public void ConfigureServices (IServiceCollection services)
|
||||
{
|
||||
services.AddOptions();
|
||||
var siteSettingsconf = Configuration.GetSection("Site");
|
||||
services.Configure<SiteSettings>(siteSettingsconf);
|
||||
var smtpSettingsconf = Configuration.GetSection("Smtp");
|
||||
services.Configure<SmtpSettings>(smtpSettingsconf);
|
||||
services.AddInstance(typeof(ILoggerFactory), new LoggerFactory());
|
||||
services.AddTransient(typeof(IEmailSender), typeof(MailSender));
|
||||
services.AddEntityFramework().AddNpgsql().AddDbContext<ApplicationDbContext>();
|
||||
services.AddTransient((s) => new RazorTemplateEngine(s.GetService<RazorEngineHost>()));
|
||||
services.AddLogging();
|
||||
services.AddTransient<EMailer>();
|
||||
services.AddLocalization(options =>
|
||||
{
|
||||
options.ResourcesPath = "Resources";
|
||||
});
|
||||
|
||||
services.AddEntityFramework()
|
||||
.AddNpgsql()
|
||||
.AddDbContext<ApplicationDbContext>(
|
||||
db => db.UseNpgsql(ConnectionString)
|
||||
);
|
||||
services.Configure<SharedAuthenticationOptions>(options =>
|
||||
{
|
||||
options.SignInScheme = "Bearer";
|
||||
});
|
||||
|
||||
services.AddTransient<Microsoft.Extensions.WebEncoders.UrlEncoder, UrlEncoder>();
|
||||
|
||||
services.AddAuthentication();
|
||||
|
||||
}
|
||||
|
||||
public void Configure (IApplicationBuilder app, IHostingEnvironment env,
|
||||
IOptions<SiteSettings> siteSettings, ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
|
||||
loggerFactory.AddDebug();
|
||||
logger = loggerFactory.CreateLogger<Startup>();
|
||||
logger.LogInformation(env.EnvironmentName);
|
||||
var authConf = Configuration.GetSection("Authentication").GetSection("Yavsc");
|
||||
var clientId = authConf.GetSection("ClientId").Value;
|
||||
var clientSecret = authConf.GetSection("ClientSecret").Value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
24
test/appsettings.json
Normal file
24
test/appsettings.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"Site": {
|
||||
"Authority": "dev.pschneider.fr",
|
||||
"Title": "Yavsc dev",
|
||||
"Slogan": "Yavsc : WIP.",
|
||||
"Banner": "/images/yavsc.png",
|
||||
"HomeViewName": "Home",
|
||||
"FavIcon": "/favicon.ico",
|
||||
"Icon": "/images/yavsc.png"
|
||||
},
|
||||
"Logging": {
|
||||
"IncludeScopes": true,
|
||||
"LogLevel": {
|
||||
"Default": "Debug",
|
||||
"System": "Warning",
|
||||
"Microsoft": "Warning"
|
||||
}
|
||||
},
|
||||
"Data": {
|
||||
"DefaultConnection": {
|
||||
"ConnectionString": "Server=localhost;Port=5432;Database=YavscDev;Username=yavscdev;Password=admin;"
|
||||
}
|
||||
}
|
||||
}
|
@ -28,9 +28,6 @@
|
||||
"defaultNamespace": "Yavsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"Yavsc": {
|
||||
"target": "project"
|
||||
},
|
||||
"Newtonsoft.Json": "9.0.1",
|
||||
"xunit": "2.1.0",
|
||||
"xunit.analyzers": "0.9.0",
|
||||
@ -39,13 +36,13 @@
|
||||
"Microsoft.Dnx.TestHost": "1.0.0-rc1-final",
|
||||
"Microsoft.Dnx.Runtime": "1.0.0-rc1-final",
|
||||
"xunit.runner.dnx": "2.1.0-rc1-build204",
|
||||
"Yavsc.Abstract": "1.0.5-rc21-beta5",
|
||||
"Yavsc.Server": "1.0.5-rc21-beta5"
|
||||
"Yavsc": { "target": "project" }
|
||||
},
|
||||
"frameworks": {
|
||||
"dnx451": {}
|
||||
},
|
||||
"commands": {
|
||||
"test": "xunit.runner.dnx"
|
||||
}
|
||||
},
|
||||
"userSecretsId": "aspnet5-YavscWeb-a0dadd21-2ced-43d3-96f9-7e504345102f"
|
||||
}
|
||||
|
103
test/src/EMailling.cs
Normal file
103
test/src/EMailling.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Hosting.Internal;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using Yavsc.Abstract.Manage;
|
||||
using Yavsc.Lib;
|
||||
using Yavsc.Services;
|
||||
|
||||
namespace Yavsc.test
|
||||
{
|
||||
|
||||
|
||||
public class ServerSideFixture : IDisposable {
|
||||
public SiteSettings _siteSetup;
|
||||
public ILogger _logger;
|
||||
public IApplication _app;
|
||||
public EMailer _mailer;
|
||||
public ILoggerFactory _loggerFactory;
|
||||
public IEmailSender _mailSender;
|
||||
|
||||
public ServerSideFixture()
|
||||
{
|
||||
InitServices();
|
||||
_logger = _loggerFactory.CreateLogger<ServerSideFixture> ();
|
||||
_logger.LogInformation("ServerSideFixture");
|
||||
}
|
||||
void InitServices()
|
||||
{
|
||||
var host = new WebHostBuilder();
|
||||
|
||||
var hostengnine = host
|
||||
.UseEnvironment("Development")
|
||||
.UseServer("test")
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
|
||||
_app = hostengnine.Start();
|
||||
_mailer = _app.Services.GetService(typeof(EMailer)) as EMailer;
|
||||
_loggerFactory = _app.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
||||
var siteSetup = _app.Services.GetService(typeof(IOptions<SiteSettings>)) as IOptions<SiteSettings>;
|
||||
_siteSetup = siteSetup.Value;
|
||||
_mailSender = _app.Services.GetService(typeof(IEmailSender)) as IEmailSender;
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_logger.LogInformation("Disposing");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Collection("EMaillingTeststCollection")]
|
||||
public class EMaillingTests : IClassFixture<ServerSideFixture>
|
||||
|
||||
{
|
||||
ServerSideFixture _serverFixture;
|
||||
ITestOutputHelper output;
|
||||
public EMaillingTests(ServerSideFixture serverFixture, ITestOutputHelper output)
|
||||
{
|
||||
this.output = output;
|
||||
_serverFixture = serverFixture;
|
||||
}
|
||||
|
||||
void InitServices()
|
||||
{
|
||||
var host = new WebHostBuilder();
|
||||
|
||||
var hostengnine = host
|
||||
.UseEnvironment("Development")
|
||||
.UseServer("test")
|
||||
.UseStartup<Startup>()
|
||||
.Build();
|
||||
|
||||
var app = hostengnine.Start();
|
||||
var sender = app.Services.GetService(typeof(IEmailSender)) as IEmailSender;
|
||||
var mailer = app.Services.GetService(typeof(EMailer)) as EMailer;
|
||||
var loggerFactory = app.Services.GetService(typeof(ILoggerFactory)) as ILoggerFactory;
|
||||
ILogger logger = loggerFactory.CreateLogger<Program>() ;
|
||||
mailer.SendMonthlyEmail(1,"UserOrientedTemplate");
|
||||
logger.LogInformation("Finished");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
public void SendEMailSynchrone()
|
||||
{
|
||||
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)
|
||||
_serverFixture._logger.LogError("No info on sending");
|
||||
else if (!mailSentInfo.Sent)
|
||||
_serverFixture._logger.LogError($"{mailSentInfo.ErrorMessage}");
|
||||
else
|
||||
_serverFixture._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}");
|
||||
}
|
||||
}
|
||||
}
|
54
test/src/NotWorking.cs
Normal file
54
test/src/NotWorking.cs
Normal file
@ -0,0 +1,54 @@
|
||||
// // NotWorking.cs
|
||||
// /*
|
||||
// paul 21/06/2018 10:16 20182018 6 21
|
||||
// */
|
||||
using System;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Xunit;
|
||||
using Microsoft.Dnx.Compilation.CSharp;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.AspNet.Builder.Internal;
|
||||
using Yavsc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
[Collection("Yavsc dropped intents")]
|
||||
public class NotWorking : BaseTestContext
|
||||
{
|
||||
|
||||
public void StringLocalizer()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
// IHostingEnvironment env = null;
|
||||
// IOptions<SiteSettings> siteSettings;
|
||||
|
||||
services.AddTransient<IRuntimeEnvironment>(
|
||||
svs => PlatformServices.Default.Runtime
|
||||
);
|
||||
beforeCompileContext = YavscMandatory.CreateYavscCompilationContext();
|
||||
var prjDir = beforeCompileContext.ProjectContext.ProjectDirectory;
|
||||
YavscMandatory.ConfigureServices(services, prjDir, out configuration, out provider);
|
||||
|
||||
IApplicationBuilder app = new ApplicationBuilder(provider);
|
||||
var rtd = app.Build();
|
||||
IOptions<LocalizationOptions> localOptions = Activator.CreateInstance<IOptions<LocalizationOptions>>(); ;
|
||||
// TODO build applicationEnvironment
|
||||
ResourceManagerStringLocalizerFactory strFact = new ResourceManagerStringLocalizerFactory
|
||||
(applicationEnvironment, localOptions);
|
||||
IStringLocalizer stringLocalizer = strFact.Create(typeof(NotWorking));
|
||||
}
|
||||
|
||||
public void NoDnxEnv()
|
||||
{
|
||||
|
||||
IOptions<LocalizationOptions> localOptions = Activator.CreateInstance<IOptions<LocalizationOptions>>();
|
||||
ResourceManagerStringLocalizerFactory strFact = new ResourceManagerStringLocalizerFactory(applicationEnvironment, localOptions);
|
||||
IStringLocalizer stringLocalizer = strFact.Create(typeof(NotWorking));
|
||||
}
|
||||
}
|
||||
}
|
233
test/src/YavscMandatory.cs
Executable file
233
test/src/YavscMandatory.cs
Executable file
@ -0,0 +1,233 @@
|
||||
using System;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using Microsoft.AspNet.Builder.Internal;
|
||||
using Microsoft.AspNet.Razor;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.PlatformAbstractions;
|
||||
using Xunit;
|
||||
using Yavsc;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Services;
|
||||
using System.Runtime.Versioning;
|
||||
using Microsoft.AspNet.Mvc.Razor;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.Dnx.Compilation.CSharp;
|
||||
using Microsoft.Extensions.OptionsModel;
|
||||
using Yavsc.Helpers;
|
||||
using Microsoft.Data.Entity;
|
||||
using Xunit.Abstractions;
|
||||
using System.IO;
|
||||
|
||||
namespace Test
|
||||
{
|
||||
public class BaseTestContext {
|
||||
protected IApplicationEnvironment applicationEnvironment = null;
|
||||
protected IServiceProvider serviceProvider = null;
|
||||
protected IConfigurationRoot configurationRoot;
|
||||
protected BeforeCompileContext beforeCompileContext;
|
||||
protected string testprojectAssetPath = "/home/paul/workspace/yavsc/Yavsc";
|
||||
|
||||
protected IServiceProvider provider;
|
||||
protected IConfigurationRoot configuration;
|
||||
}
|
||||
|
||||
[Collection("Yavsc mandatory success story")]
|
||||
public class YavscMandatory: BaseTestContext
|
||||
{
|
||||
private readonly ITestOutputHelper output;
|
||||
public YavscMandatory(ITestOutputHelper output)
|
||||
{
|
||||
this.output = output;
|
||||
}
|
||||
|
||||
[Fact]
|
||||
void TestStartNodeJsansitohtml()
|
||||
{
|
||||
var procStart = new ProcessStartInfo("env", "/usr/bin/nodejs node_modules/ansi-to-html/bin/ansi-to-html");
|
||||
procStart.UseShellExecute = false;
|
||||
procStart.RedirectStandardInput = true;
|
||||
procStart.RedirectStandardOutput = true;
|
||||
procStart.RedirectStandardError = true;
|
||||
var proc = Process.Start(procStart);
|
||||
|
||||
proc.StandardInput.WriteLine("\x001b[30mblack\x1b[37mwhite");
|
||||
proc.StandardInput.Close();
|
||||
while (!proc.StandardOutput.EndOfStream)
|
||||
{
|
||||
output.WriteLine(proc.StandardOutput.ReadLine());
|
||||
}
|
||||
}
|
||||
|
||||
// actually uses node's ansi-to-html
|
||||
[Fact]
|
||||
void AnsiToHtml()
|
||||
{
|
||||
var procStart = new ProcessStartInfo("ls", "-l --color=always");
|
||||
procStart.UseShellExecute = false;
|
||||
procStart.RedirectStandardInput = false;
|
||||
procStart.RedirectStandardOutput = true;
|
||||
var proc = Process.Start(procStart);
|
||||
var encoded = AnsiToHtmlEncoder.GetStream(proc.StandardOutput);
|
||||
using (var reader = new StreamReader(encoded))
|
||||
{
|
||||
var txt = reader.ReadToEnd();
|
||||
output.WriteLine(txt);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ApplicationDbContextExists()
|
||||
{
|
||||
var dbc = new ApplicationDbContext();
|
||||
Assert.NotNull(dbc.GCMDevices);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void MvcRazorHostAndParser()
|
||||
{
|
||||
string cache = System.IO.Directory.GetCurrentDirectory();
|
||||
MvcRazorHost host = new MvcRazorHost(cache);
|
||||
var parser = host.CreateMarkupParser();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
void HaveDependecyInjection()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
void HaveHost()
|
||||
{
|
||||
beforeCompileContext = CreateYavscCompilationContext();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AConfigurationRoot()
|
||||
{
|
||||
var builder = new ConfigurationBuilder();
|
||||
builder.AddJsonFile(Path.Combine(testprojectAssetPath, "appsettings.json"), false);
|
||||
builder.AddJsonFile(Path.Combine(testprojectAssetPath, "appsettings.Development.json"), true);
|
||||
configurationRoot = builder.Build();
|
||||
}
|
||||
|
||||
internal static BeforeCompileContext CreateYavscCompilationContext()
|
||||
{
|
||||
var projectContext = new ProjectContext();
|
||||
projectContext.Name = "Yavsc";
|
||||
projectContext.ProjectDirectory = "/home/paul/workspace/yavsc/Yavsc";
|
||||
projectContext.ProjectFilePath = "/home/paul/workspace/yavsc/Yavsc/project.json";
|
||||
projectContext.TargetFramework = new FrameworkName("DNX", new Version(4, 5, 1));
|
||||
projectContext.Configuration = "Development";
|
||||
|
||||
return new BeforeCompileContext(
|
||||
null, projectContext, () => null, () => null, () => null);
|
||||
}
|
||||
|
||||
internal static IConfigurationRoot CreateConfiguration(string prjDir)
|
||||
{
|
||||
var builder = new ConfigurationBuilder();
|
||||
|
||||
builder.AddJsonFile(Path.Combine(prjDir, "appsettings.json"), true);
|
||||
builder.AddJsonFile(Path.Combine(prjDir, "appsettings.Development.json"), true);
|
||||
return builder.Build();
|
||||
}
|
||||
|
||||
internal static void ConfigureServices
|
||||
(ServiceCollection serviceCollection,
|
||||
string prjDir,
|
||||
out IConfigurationRoot configuration,
|
||||
out IServiceProvider provider)
|
||||
{
|
||||
configuration = CreateConfiguration(prjDir);
|
||||
|
||||
serviceCollection.AddOptions();
|
||||
var siteSettingsconf = configuration.GetSection("Site");
|
||||
serviceCollection.Configure<SiteSettings>(siteSettingsconf);
|
||||
var smtpSettingsconf = configuration.GetSection("Smtp");
|
||||
serviceCollection.Configure<SmtpSettings>(smtpSettingsconf);
|
||||
var locOptions = configuration.GetSection("Localization");
|
||||
serviceCollection.Configure<LocalizationOptions>(locOptions);
|
||||
|
||||
serviceCollection.AddSingleton(typeof(ILoggerFactory), typeof(LoggerFactory));
|
||||
serviceCollection.AddTransient(typeof(IEmailSender), typeof(MailSender));
|
||||
serviceCollection.AddTransient(typeof(RazorEngineHost));
|
||||
serviceCollection.AddTransient((s) => new RazorTemplateEngine(s.GetService<RazorEngineHost>()));
|
||||
serviceCollection.AddLogging();
|
||||
serviceCollection.AddMvcCore();
|
||||
serviceCollection.AddLocalization(options =>
|
||||
{
|
||||
options.ResourcesPath = "Resources";
|
||||
});
|
||||
var connectionString = configuration["Data:DefaultConnection:ConnectionString"];
|
||||
AppDomain.CurrentDomain.SetData("YAVSC_DB_CONNECTION", connectionString);
|
||||
serviceCollection.AddEntityFramework()
|
||||
.AddNpgsql()
|
||||
.AddDbContext<ApplicationDbContext>(
|
||||
db => db.UseNpgsql(connectionString)
|
||||
);
|
||||
provider = serviceCollection.BuildServiceProvider();
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void ARequestAppDelegate()
|
||||
{
|
||||
var services = new ServiceCollection();
|
||||
|
||||
services.AddTransient<IRuntimeEnvironment>(
|
||||
svs => PlatformServices.Default.Runtime
|
||||
);
|
||||
|
||||
HaveHost();
|
||||
var prjDir = this.beforeCompileContext.ProjectContext.ProjectDirectory;
|
||||
ConfigureServices(services, prjDir, out configurationRoot, out serviceProvider);
|
||||
|
||||
IApplicationBuilder app = new ApplicationBuilder(serviceProvider);
|
||||
var rtd = app.Build();
|
||||
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void MessageSenderFromLib()
|
||||
{
|
||||
ARequestAppDelegate();
|
||||
ILoggerFactory factory = ActivatorUtilities.GetServiceOrCreateInstance<ILoggerFactory>(serviceProvider);
|
||||
var dbc = new ApplicationDbContext();
|
||||
|
||||
IOptions<SiteSettings> siteOptions =
|
||||
ActivatorUtilities.GetServiceOrCreateInstance<IOptions<SiteSettings>>(serviceProvider);
|
||||
;
|
||||
IOptions<SmtpSettings> smtpOptions = ActivatorUtilities.GetServiceOrCreateInstance<IOptions<SmtpSettings>>(serviceProvider);
|
||||
;
|
||||
IOptions<GoogleAuthSettings> googleOptions = ActivatorUtilities.GetServiceOrCreateInstance<IOptions<GoogleAuthSettings>>(serviceProvider);
|
||||
;
|
||||
IEmailSender eSender = new MailSender
|
||||
(factory, siteOptions, smtpOptions, googleOptions);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void InitApplicationBuilder()
|
||||
{
|
||||
|
||||
var services = new ServiceCollection();
|
||||
|
||||
services.AddTransient<IRuntimeEnvironment>(
|
||||
svs => PlatformServices.Default.Runtime
|
||||
);
|
||||
beforeCompileContext = YavscMandatory.CreateYavscCompilationContext();
|
||||
var prjDir = beforeCompileContext.ProjectContext.ProjectDirectory;
|
||||
YavscMandatory.ConfigureServices(services, prjDir, out configuration, out provider);
|
||||
|
||||
IApplicationBuilder app = new ApplicationBuilder(provider);
|
||||
app.UseMvc();
|
||||
var rtd = app.Build();
|
||||
IOptions<LocalizationOptions> localOptions = ActivatorUtilities.GetServiceOrCreateInstance<IOptions<LocalizationOptions>>(provider); ;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
@ -24,7 +24,6 @@ namespace Test
|
||||
public class YavscWorkInProgress : BaseTestContext
|
||||
{
|
||||
|
||||
[Fact]
|
||||
public void GitClone()
|
||||
{
|
||||
|
||||
|
Reference in New Issue
Block a user