Updated test to use new ServiceCollection

This commit is contained in:
David Fowler 2014-03-14 23:57:41 -07:00
parent 4c1f4e26ff
commit 389815482e
2 changed files with 20 additions and 17 deletions

View File

@ -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

View File

@ -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<TKey>
where TKey : IEquatable<TKey>
{
return new ServiceProvider().Add(TestServices.DefaultServices<TUser, TKey>());
var serviceCollection = new ServiceCollection();
serviceCollection.Add(TestServices.DefaultServices<TUser, TKey>());
return serviceCollection.BuildServiceProvider();
}
public static IEnumerable<IServiceDescriptor> DefaultServices<TUser, TKey>()
public static IEnumerable<IServiceDescriptor> DefaultServices<TUser, TKey>()
where TUser : class,IUser<TKey>
where TKey : IEquatable<TKey>
{
@ -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