internal static void GeneratesActionUrl(RouteCollection routes, HttpMethod httpMethod, string expectedUrl, RouteValues fromProps, string appPath, string requestBody) { fromProps.CheckDataOk(); if (!fromProps.DataOk) { return; } var routeValueDict = fromProps.AsRouteValueDictionary(); GeneratesActionUrl(routes, httpMethod, expectedUrl, fromProps.Action, fromProps.Controller, appPath, routeValueDict, requestBody); }
public void AsRouteValueDictionaryReadsAllValues() { var data = new Dictionary<string, object> { { "id", 3 } }; var values = new RouteValues(data); values.Controller = "foo"; values.Action = "bar"; values.Area = "fish"; var outValues = values.AsRouteValueDictionary(); Assert.That(outValues.Count, Is.EqualTo(4)); Assert.That(outValues["controller"], Is.EqualTo("foo")); Assert.That(outValues["action"], Is.EqualTo("bar")); Assert.That(outValues["area"], Is.EqualTo("fish")); Assert.That(outValues["id"], Is.EqualTo(3)); }