From 389815482ec68e3cfb881b4067e5a480c26b3363 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 14 Mar 2014 23:57:41 -0700 Subject: [PATCH] Updated test to use new ServiceCollection --- Identity.sln | 24 +++++++++---------- .../TestServices.cs | 13 ++++++---- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/Identity.sln b/Identity.sln index b17675f8b2..b7371f8f9d 100644 --- a/Identity.sln +++ b/Identity.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.21005.1 +VisualStudioVersion = 12.0.30313.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0F647068-6602-4E24-B1DC-8ED91481A50A}" EndProject @@ -25,7 +25,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Identity.I EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Identity.Test.net45", "test\Microsoft.AspNet.Identity.Test\Microsoft.AspNet.Identity.Test.net45.csproj", "{E00E23B0-79B8-41E1-9998-57FECA1F2535}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Aspnet.Identity.InMemory.Test.net45", "test\Microsoft.Aspnet.Identity.InMemory.Test\Microsoft.Aspnet.Identity.InMemory.Test.net45.csproj", "{9414FC28-D49C-427E-A0FE-992BDBD78B8E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Aspnet.Identity.InMemory.Test.net45", "test\Microsoft.Aspnet.Identity.InMemory.Test\Microsoft.Aspnet.Identity.InMemory.Test.net45.csproj", "{2C0D3053-1B4E-4654-A70E-13A9422D53E9}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -61,24 +61,24 @@ Global {E00E23B0-79B8-41E1-9998-57FECA1F2535}.Debug|Any CPU.Build.0 = Debug|Any CPU {E00E23B0-79B8-41E1-9998-57FECA1F2535}.Release|Any CPU.ActiveCfg = Release|Any CPU {E00E23B0-79B8-41E1-9998-57FECA1F2535}.Release|Any CPU.Build.0 = Release|Any CPU - {9414FC28-D49C-427E-A0FE-992BDBD78B8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9414FC28-D49C-427E-A0FE-992BDBD78B8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9414FC28-D49C-427E-A0FE-992BDBD78B8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9414FC28-D49C-427E-A0FE-992BDBD78B8E}.Release|Any CPU.Build.0 = Release|Any CPU + {2C0D3053-1B4E-4654-A70E-13A9422D53E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C0D3053-1B4E-4654-A70E-13A9422D53E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C0D3053-1B4E-4654-A70E-13A9422D53E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C0D3053-1B4E-4654-A70E-13A9422D53E9}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {F6B0C0E9-C346-49D0-B583-95B6CE04BB1B} = {0F647068-6602-4E24-B1DC-8ED91481A50A} - {77CEDA6C-A833-455D-8357-649BFD944724} = {0F647068-6602-4E24-B1DC-8ED91481A50A} - {E00E23B0-79B8-41E1-9998-57FECA1F2535} = {52D59F18-62D2-4D17-8CF2-BE192445AF8E} - {9414FC28-D49C-427E-A0FE-992BDBD78B8E} = {52D59F18-62D2-4D17-8CF2-BE192445AF8E} {B72401D7-47F6-4A98-89D5-CCBFEFC5B2B8} = {F6B0C0E9-C346-49D0-B583-95B6CE04BB1B} - {E52361C9-1F0B-4229-86A0-E5C7C12A5429} = {F6B0C0E9-C346-49D0-B583-95B6CE04BB1B} - {054B3FFA-7196-466F-9A8A-593FFE037A69} = {F6B0C0E9-C346-49D0-B583-95B6CE04BB1B} {6211450F-FFB8-431F-84E2-9A7620875260} = {77CEDA6C-A833-455D-8357-649BFD944724} + {77CEDA6C-A833-455D-8357-649BFD944724} = {0F647068-6602-4E24-B1DC-8ED91481A50A} + {F6B0C0E9-C346-49D0-B583-95B6CE04BB1B} = {0F647068-6602-4E24-B1DC-8ED91481A50A} + {E52361C9-1F0B-4229-86A0-E5C7C12A5429} = {F6B0C0E9-C346-49D0-B583-95B6CE04BB1B} {D32483A4-B617-480C-81E6-49CD596B9A34} = {77CEDA6C-A833-455D-8357-649BFD944724} + {054B3FFA-7196-466F-9A8A-593FFE037A69} = {F6B0C0E9-C346-49D0-B583-95B6CE04BB1B} {D2E7A146-C39F-4302-8EA3-BFA8C1082939} = {77CEDA6C-A833-455D-8357-649BFD944724} + {E00E23B0-79B8-41E1-9998-57FECA1F2535} = {52D59F18-62D2-4D17-8CF2-BE192445AF8E} + {2C0D3053-1B4E-4654-A70E-13A9422D53E9} = {52D59F18-62D2-4D17-8CF2-BE192445AF8E} EndGlobalSection EndGlobal diff --git a/test/Microsoft.AspNet.Identity.Test/TestServices.cs b/test/Microsoft.AspNet.Identity.Test/TestServices.cs index 821ddb281f..8ba4a45028 100644 --- a/test/Microsoft.AspNet.Identity.Test/TestServices.cs +++ b/test/Microsoft.AspNet.Identity.Test/TestServices.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using Microsoft.AspNet.DependencyInjection; +using Microsoft.AspNet.DependencyInjection.Fallback; namespace Microsoft.AspNet.Identity.Test { @@ -10,10 +11,12 @@ namespace Microsoft.AspNet.Identity.Test where TUser : class,IUser where TKey : IEquatable { - return new ServiceProvider().Add(TestServices.DefaultServices()); + var serviceCollection = new ServiceCollection(); + serviceCollection.Add(TestServices.DefaultServices()); + return serviceCollection.BuildServiceProvider(); } - public static IEnumerable DefaultServices() + public static IEnumerable DefaultServices() where TUser : class,IUser where TKey : IEquatable { @@ -36,12 +39,12 @@ namespace Microsoft.AspNet.Identity.Test public Type ServiceType { - get { return typeof (TService); } + get { return typeof(TService); } } public Type ImplementationType { - get { return typeof (TImplementation); } + get { return typeof(TImplementation); } } public object ImplementationInstance @@ -64,7 +67,7 @@ namespace Microsoft.AspNet.Identity.Test public Type ServiceType { - get { return typeof (TService); } + get { return typeof(TService); } } public Type ImplementationType