unit tests pass...

This commit is contained in:
Tom Pallister
2017-09-25 13:13:07 +01:00
parent 1c98dcbca3
commit 6419919e74
12 changed files with 38 additions and 28 deletions

View File

@ -275,7 +275,7 @@ namespace Ocelot.AcceptanceTests
{
services.AddLogging();
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddDeveloperSigningCredential()
.AddInMemoryApiResources(new List<ApiResource>
{
new ApiResource

View File

@ -259,7 +259,7 @@ namespace Ocelot.AcceptanceTests
{
services.AddLogging();
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddDeveloperSigningCredential()
.AddInMemoryApiResources(new List<ApiResource>
{
new ApiResource

View File

@ -133,7 +133,7 @@ namespace Ocelot.AcceptanceTests
{
services.AddLogging();
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddDeveloperSigningCredential()
.AddInMemoryApiResources(new List<ApiResource>
{
new ApiResource

View File

@ -140,7 +140,7 @@ namespace Ocelot.AcceptanceTests
{
services.AddLogging();
services.AddIdentityServer()
.AddTemporarySigningCredential()
.AddDeveloperSigningCredential()
.AddInMemoryApiResources(new List<ApiResource>
{
new ApiResource

View File

@ -31,6 +31,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta2-build1317" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" />

View File

@ -134,6 +134,7 @@ namespace Ocelot.AcceptanceTests
.AddJsonFile("configuration.json")
.AddEnvironmentVariables();
IServiceCollection serviceCollection = new ServiceCollection();
var configuration = builder.Build();
_webHostBuilder = new WebHostBuilder();
@ -157,15 +158,16 @@ namespace Ocelot.AcceptanceTests
};
s.AddOcelot(configuration, settings);
serviceCollection = s;
})
.ConfigureLogging(l =>
{
l.AddConsole(configuration.GetSection("Logging"));
l.AddConsole();
l.AddDebug();
})
.Configure(a =>
{
a.UseOcelot(ocelotMiddlewareConfig).Wait();
a.UseOcelot(ocelotMiddlewareConfig, serviceCollection).Wait();
}));
_ocelotClient = _ocelotServer.CreateClient();

View File

@ -26,6 +26,7 @@ namespace Ocelot.ManualTest
}
public IConfigurationRoot Configuration { get; }
public IServiceCollection Services { get; private set; }
public void ConfigureServices(IServiceCollection services)
{
@ -39,13 +40,14 @@ namespace Ocelot.ManualTest
};
services.AddOcelot(Configuration, settings);
Services = services;
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
app.UseOcelot().Wait();
app.UseOcelot(Services).Wait();
}
}
}

View File

@ -33,6 +33,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.0-beta2-build1317" />
<PackageReference Include="Microsoft.DotNet.InternalAbstractions" Version="1.0.0" />