Change the namespace for the MapRoute extension

This commit is contained in:
Pranav K 2015-01-23 15:20:51 -08:00
parent 26d7a6f6ee
commit 29a5cb8aa9
3 changed files with 20 additions and 21 deletions

View File

@ -3,10 +3,11 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNet.Routing;
using Microsoft.AspNet.Routing.Template; using Microsoft.AspNet.Routing.Template;
using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection;
namespace Microsoft.AspNet.Routing namespace Microsoft.AspNet.Builder
{ {
public static class RouteBuilderExtensions public static class RouteBuilderExtensions
{ {

View File

@ -6,6 +6,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http; using Microsoft.AspNet.Http;
using Microsoft.AspNet.Routing.Constraints; using Microsoft.AspNet.Routing.Constraints;
using Microsoft.AspNet.Routing.Logging; using Microsoft.AspNet.Routing.Logging;
@ -210,7 +211,7 @@ namespace Microsoft.AspNet.Routing.Template
Assert.True(routeValues.ContainsKey("country")); Assert.True(routeValues.ContainsKey("country"));
Assert.Equal("USA", routeValues["country"]); Assert.Equal("USA", routeValues["country"]);
Assert.True(routeValues.ContainsKey("id")); Assert.True(routeValues.ContainsKey("id"));
Assert.Equal("5",routeValues["id"]); Assert.Equal("5", routeValues["id"]);
Assert.True(context.RouteData.Values.ContainsKey("country")); Assert.True(context.RouteData.Values.ContainsKey("country"));
Assert.Equal("USA", context.RouteData.Values["country"]); Assert.Equal("USA", context.RouteData.Values["country"]);
@ -1243,7 +1244,7 @@ namespace Microsoft.AspNet.Routing.Template
// Arrange // Arrange
var route = CreateRoute("{controller}/{action}/{id:int}"); var route = CreateRoute("{controller}/{action}/{id:int}");
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home", id = 4 }); values: new { action = "Index", controller = "Home", id = 4 });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);
@ -1359,7 +1360,7 @@ namespace Microsoft.AspNet.Routing.Template
constraints: null); constraints: null);
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home", name = "products", format = "xml"}); values: new { action = "Index", controller = "Home", name = "products", format = "xml" });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);
@ -1379,7 +1380,7 @@ namespace Microsoft.AspNet.Routing.Template
constraints: null); constraints: null);
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home", name = "products"}); values: new { action = "Index", controller = "Home", name = "products" });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);
@ -1399,7 +1400,7 @@ namespace Microsoft.AspNet.Routing.Template
constraints: null); constraints: null);
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home", name = "products" , format = "xml"}); values: new { action = "Index", controller = "Home", name = "products", format = "xml" });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);
@ -1419,7 +1420,7 @@ namespace Microsoft.AspNet.Routing.Template
constraints: null); constraints: null);
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home", name = "products"}); values: new { action = "Index", controller = "Home", name = "products" });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);
@ -1459,7 +1460,7 @@ namespace Microsoft.AspNet.Routing.Template
constraints: null); constraints: null);
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home", name = "products"}); values: new { action = "Index", controller = "Home", name = "products" });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);
@ -1479,7 +1480,7 @@ namespace Microsoft.AspNet.Routing.Template
constraints: null); constraints: null);
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home"}); values: new { action = "Index", controller = "Home" });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);
@ -1499,7 +1500,7 @@ namespace Microsoft.AspNet.Routing.Template
constraints: null); constraints: null);
var context = CreateVirtualPathContext( var context = CreateVirtualPathContext(
values: new { action = "Index", controller = "Home"}); values: new { action = "Index", controller = "Home" });
// Act // Act
var path = route.GetVirtualPath(context); var path = route.GetVirtualPath(context);

View File

@ -4,10 +4,7 @@
#if ASPNET50 #if ASPNET50
using System; using System;
using System.Collections.Generic; using Microsoft.AspNet.Builder;
using System.Linq.Expressions;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Routing.Constraints;
using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.DependencyInjection;
using Microsoft.Framework.DependencyInjection.Fallback; using Microsoft.Framework.DependencyInjection.Fallback;
using Microsoft.Framework.OptionsModel; using Microsoft.Framework.OptionsModel;