Handle IBuilder rename to IApplicationBuilder.
This commit is contained in:
parent
cde1a95d49
commit
85ad1aeb96
|
|
@ -17,7 +17,7 @@ namespace MvcSample.Web
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
app.UseFileServer();
|
||||
#if ASPNET50
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Mvc.Internal
|
|||
if (services.GetServiceOrNull(typeof(MvcMarkerService)) == null)
|
||||
{
|
||||
throw new InvalidOperationException(Resources.FormatUnableToFindServices(
|
||||
"IServiceCollection.AddMvc()", "IBuilder.UseServices(...)", "IBuilder.UseMvc(...)"));
|
||||
"IServiceCollection.AddMvc()", "IApplicationBuilder.UseServices(...)", "IApplicationBuilder.UseMvc(...)"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Builder
|
|||
{
|
||||
public static class BuilderExtensions
|
||||
{
|
||||
public static IBuilder UseMvc([NotNull] this IBuilder app)
|
||||
public static IApplicationBuilder UseMvc([NotNull] this IApplicationBuilder app)
|
||||
{
|
||||
return app.UseMvc(routes =>
|
||||
{
|
||||
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Builder
|
|||
});
|
||||
}
|
||||
|
||||
public static IBuilder UseMvc([NotNull] this IBuilder app, [NotNull] Action<IRouteBuilder> configureRoutes)
|
||||
public static IApplicationBuilder UseMvc([NotNull] this IApplicationBuilder app, [NotNull] Action<IRouteBuilder> configureRoutes)
|
||||
{
|
||||
// Verify if AddMvc was done before calling UseMvc
|
||||
// We use the MvcMarkerService to make sure if all the services were added.
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ namespace Microsoft.AspNet.Mvc
|
|||
services.Setup(o => o.GetService(typeof(IEnumerable<MvcMarkerService>)))
|
||||
.Returns(new List<MvcMarkerService>());
|
||||
var expectedMessage = "Unable to find the required services. Please add all the required " +
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IBuilder.UseServices(...)' " +
|
||||
"or 'IBuilder.UseMvc(...)' in the application startup code.";
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IApplicationBuilder.UseServices(...)' " +
|
||||
"or 'IApplicationBuilder.UseMvc(...)' in the application startup code.";
|
||||
|
||||
// Act & Assert
|
||||
var ex = Assert.Throws<InvalidOperationException>(
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class ActivatorTests
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("ActivatorWebSite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task ControllerThatCannotBeActivated_ThrowsWhenAttemptedToBeInvoked()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class AntiForgeryTests
|
||||
{
|
||||
private readonly IServiceProvider _services = TestHelper.CreateServices("AntiForgeryWebSite");
|
||||
private readonly Action<IBuilder> _app = new AntiForgeryWebSite.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new AntiForgeryWebSite.Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task MultipleAFTokensWithinTheSamePage_AreAllowed()
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class BasicTests
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("BasicWebSite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
// Some tests require comparing the actual response body against an expected response baseline
|
||||
// so they require a reference to the assembly on which the resources are located, in order to
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class CompositeViewEngineTests
|
||||
{
|
||||
private readonly IServiceProvider _services = TestHelper.CreateServices("CompositeViewEngine");
|
||||
private readonly Action<IBuilder> _app = new CompositeViewEngine.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new CompositeViewEngine.Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task CompositeViewEngine_FindsPartialViewsAcrossAllEngines()
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class ConnegTests
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("ConnegWebsite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task ProducesContentAttribute_SingleContentType_PicksTheFirstSupportedFormatter()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
{
|
||||
// Arrange
|
||||
var provider = TestHelper.CreateServices("AutofacWebSite");
|
||||
Action<IBuilder> app = new Startup().Configure;
|
||||
Action<IApplicationBuilder> app = new Startup().Configure;
|
||||
HttpResponseMessage response = null;
|
||||
|
||||
// Act & Assert
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class DirectivesTest
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("RazorWebSite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task ViewsInheritsUsingsAndInjectDirectivesFromViewStarts()
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class FlushPointTest
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("RazorWebSite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task FlushPointsAreExecutedForPagesWithLayouts()
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class InlineConstraintTests
|
||||
{
|
||||
private readonly IServiceProvider _provider;
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
public InlineConstraintTests()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class InputFormatterTests
|
||||
{
|
||||
private readonly IServiceProvider _services = TestHelper.CreateServices("FormatterWebSite");
|
||||
private readonly Action<IBuilder> _app = new FormatterWebSite.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new FormatterWebSite.Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task CheckIfXmlInputFormatterIsBeingCalled()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class ModelBindingTests
|
||||
{
|
||||
private readonly IServiceProvider _services = TestHelper.CreateServices("ModelBindingWebSite");
|
||||
private readonly Action<IBuilder> _app = new ModelBindingWebSite.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new ModelBindingWebSite.Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task ModelBindingBindsBase64StringsToByteArrays()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
// Path relative to Mvc\\test\Microsoft.AspNet.Mvc.FunctionalTests
|
||||
private readonly IServiceProvider _services =
|
||||
TestHelper.CreateServices("MvcSample.Web", Path.Combine("..", "..", "samples"));
|
||||
private readonly Action<IBuilder> _app = new MvcSample.Web.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new MvcSample.Web.Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task Home_Index_ReturnsSuccess()
|
||||
|
|
|
|||
|
|
@ -11,15 +11,15 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class MvcStartupTests
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("AddServicesWebSite");
|
||||
private readonly Action<IBuilder> _app = new AddServicesWebSite.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new AddServicesWebSite.Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public void MvcThrowsWhenRequiredServicesAreNotAdded()
|
||||
{
|
||||
// Arrange
|
||||
var expectedMessage = "Unable to find the required services. Please add all the required " +
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IBuilder.UseServices(...)' " +
|
||||
"or 'IBuilder.UseMvc(...)' in the application startup code.";
|
||||
"services by calling 'IServiceCollection.AddMvc()' inside the call to 'IApplicationBuilder.UseServices(...)' " +
|
||||
"or 'IApplicationBuilder.UseMvc(...)' in the application startup code.";
|
||||
|
||||
// Act & Assert
|
||||
var ex = Assert.Throws<InvalidOperationException>(() => TestServer.Create(_provider, _app));
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class OutputFormatterTests
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("ConnegWebsite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
[Theory]
|
||||
[InlineData("ReturnTaskOfString")]
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class RoutingTests
|
||||
{
|
||||
private readonly IServiceProvider _services = TestHelper.CreateServices("RoutingWebSite");
|
||||
private readonly Action<IBuilder> _app = new RoutingWebSite.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new RoutingWebSite.Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task ConventionRoutedController_ActionIsReachable()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class ValueProviderTest
|
||||
{
|
||||
private readonly IServiceProvider _services = TestHelper.CreateServices("ValueProvidersSite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
[Fact]
|
||||
public async Task ValueProviderFactories_AreVisitedInSequentialOrder_ForValueProviders()
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class ViewEngineTests
|
||||
{
|
||||
private readonly IServiceProvider _provider = TestHelper.CreateServices("RazorWebSite");
|
||||
private readonly Action<IBuilder> _app = new Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new Startup().Configure;
|
||||
|
||||
public static IEnumerable<object[]> RazorView_ExecutesPageAndLayoutData
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Mvc.FunctionalTests
|
|||
public class XmlOutputFormatterTests
|
||||
{
|
||||
private readonly IServiceProvider _services;
|
||||
private readonly Action<IBuilder> _app = new FormatterWebSite.Startup().Configure;
|
||||
private readonly Action<IApplicationBuilder> _app = new FormatterWebSite.Startup().Configure;
|
||||
|
||||
public XmlOutputFormatterTests()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace ActivatorWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace AddServicesWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace AntiForgeryWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
app.UseServices(services =>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace AutofacWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
app.UseServices(services => {
|
||||
services.AddMvc();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ namespace BasicWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace CompositeViewEngine
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace ConnegWebsite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace FormatterWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace InlineConstraints
|
|||
{
|
||||
public Action<IRouteBuilder> RouteCollectionProvider { get; set; }
|
||||
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Builder
|
|||
{
|
||||
public static class BuilderExtensions
|
||||
{
|
||||
public static Configuration GetTestConfiguration(this IBuilder app)
|
||||
public static Configuration GetTestConfiguration(this IApplicationBuilder app)
|
||||
{
|
||||
var configurationProvider = app.ApplicationServices.GetServiceOrDefault<ITestConfigurationProvider>();
|
||||
var configuration = configurationProvider == null
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace ModelBindingWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ namespace RazorWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace RoutingWebSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ namespace ValueProvidersSite
|
|||
{
|
||||
public class Startup
|
||||
{
|
||||
public void Configure(IBuilder app)
|
||||
public void Configure(IApplicationBuilder app)
|
||||
{
|
||||
var configuration = app.GetTestConfiguration();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue