Remove CallContextServiceLocator usages in tests

This commit is contained in:
Pavel Krymets 2015-10-21 14:13:16 -07:00
parent 8623946784
commit 84bfb8da3b
2 changed files with 3 additions and 5 deletions

View File

@ -253,8 +253,7 @@ namespace Microsoft.AspNet.Mvc.Infrastructure
private static ILibraryManager GetLibraryManager()
{
return CallContextServiceLocator.Locator.ServiceProvider
.GetRequiredService<ILibraryManager>();
return PlatformServices.Default.LibraryManager;
}
}
}

View File

@ -91,8 +91,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
Assembly startupAssembly,
Func<IServiceCollection, IServiceProvider> buildServices)
{
var applicationServices = CallContextServiceLocator.Locator.ServiceProvider;
var libraryManager = applicationServices.GetRequiredService<ILibraryManager>();
var libraryManager = PlatformServices.Default.LibraryManager;
// When an application executes in a regular context, the application base path points to the root
// directory where the application is located, for example .../samples/MvcSample.Web. However, when
@ -104,7 +103,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
var library = libraryManager.GetLibrary(applicationName);
var applicationRoot = Path.GetDirectoryName(library.Path);
var applicationEnvironment = applicationServices.GetRequiredService<IApplicationEnvironment>();
var applicationEnvironment = PlatformServices.Default.Application;
return (services) =>
{