React to DNX changes

This commit is contained in:
David Fowler 2015-10-23 02:46:29 -07:00
parent cd8252bd55
commit e89840bac8
3 changed files with 5 additions and 11 deletions

View File

@ -5,7 +5,6 @@ using Microsoft.Data.Entity;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Dnx.Runtime;
#if DNX451
using NLog.Config;
using NLog.Targets;
@ -15,14 +14,13 @@ namespace IdentitySamples
{
public partial class Startup
{
public Startup(IApplicationEnvironment env)
public Startup()
{
/*
* Below code demonstrates usage of multiple configuration sources. For instance a setting say 'setting1' is found in both the registered sources,
* then the later source will win. By this way a Local config can be overridden by a different setting while deployed remotely.
*/
var builder = new ConfigurationBuilder()
.SetBasePath(env.ApplicationBasePath)
.AddJsonFile("LocalConfig.json")
.AddEnvironmentVariables(); //All environment variables in the process's context flow in as configuration values.

View File

@ -9,7 +9,6 @@ using Microsoft.AspNet.Builder.Internal;
using Microsoft.AspNet.Identity.Test;
using Microsoft.Data.Entity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Dnx.Runtime.Infrastructure;
using Xunit;
using Microsoft.AspNet.Testing.xunit;
@ -54,8 +53,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
private ApplicationBuilder CreateBuilder()
{
var builder = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider);
builder.ApplicationServices = ConfigureServices();
var builder = new ApplicationBuilder(ConfigureServices());
return builder;
}

View File

@ -11,7 +11,6 @@ using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Authentication;
using Microsoft.AspNet.Identity.Test;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Dnx.Runtime.Infrastructure;
using Moq;
using Xunit;
@ -24,9 +23,6 @@ namespace Microsoft.AspNet.Identity.InMemory.Test
[InlineData(false)]
public async Task VerifyAccountControllerSignIn(bool isPersistent)
{
var app = new ApplicationBuilder(CallContextServiceLocator.Locator.ServiceProvider);
app.UseCookieAuthentication();
var context = new Mock<HttpContext>();
var auth = new Mock<AuthenticationManager>();
context.Setup(c => c.Authentication).Returns(auth.Object).Verifiable();
@ -43,7 +39,9 @@ namespace Microsoft.AspNet.Identity.InMemory.Test
services.AddIdentity<TestUser, TestRole>();
services.AddSingleton<IUserStore<TestUser>, InMemoryUserStore<TestUser>>();
services.AddSingleton<IRoleStore<TestRole>, InMemoryRoleStore<TestRole>>();
app.ApplicationServices = services.BuildServiceProvider();
var app = new ApplicationBuilder(services.BuildServiceProvider());
app.UseCookieAuthentication();
// Act
var user = new TestUser