public void OutBoundUrl_OfActionWithEmptyArg_IsRoutedTo_UrlWithoutParam() { Expression<Func<SkinsController, ActionResult>> action = controller => controller.Sample(string.Empty); var url = new SkinsRouter.SampleRoute().AlternateUrls.Single().ToAppRelativeUrl(); OutBoundRoute.Of(action).InArea(Area).AppRelativeUrl().ShouldEqual(url); }
public void Maps2Urls_FirstWithParam_ThenWithout() { var route = new SkinsRouter.SampleRoute(); route.Url.ShouldEqual("skins/sample/{content}"); route.AlternateUrls.ShouldNotBeNull(); route.AlternateUrls.Count().ShouldEqual(1); route.AlternateUrls.Single().ShouldEqual("skins"); }
public void InBoundUrl_WithGetMethod_AndNoParam_IsRoutedTo_ActionWithNullArg() { Expression<Func<SkinsController, ActionResult>> action = controller => controller.Sample(null); var url = new SkinsRouter.SampleRoute().AlternateUrls.Single().ToAppRelativeUrl(); url.WithMethod(HttpVerbs.Get).ShouldMapTo(action); }
public void OutBoundUrl_OfActionWithNonEmptyArg_IsRoutedTo_UrlWithParam() { const string content = "sample-content"; Expression<Func<SkinsController, ActionResult>> action = controller => controller.Sample(content); var url = new SkinsRouter.SampleRoute().Url.ToAppRelativeUrl() .Replace("{content}", content); OutBoundRoute.Of(action).InArea(Area).AppRelativeUrl().ShouldEqual(url); }
public void InBoundUrl_WithNonGetMethod_AndNonEmptyParam_IsNotRouted() { const string content = "sample-content"; var url = new SkinsRouter.SampleRoute().Url.ToAppRelativeUrl() .Replace("{content}", content); url.WithMethodsExcept(HttpVerbs.Get).ShouldMapToNothing(); }
public void InBoundUrl_WithGetMethod_AndNonEmptyParam_IsRoutedTo_ActionWithNonEmptyArg() { const string content = "sample-content"; Expression<Func<SkinsController, ActionResult>> action = controller => controller.Sample(content); var url = new SkinsRouter.SampleRoute().Url.ToAppRelativeUrl() .Replace("{content}", content); url.WithMethod(HttpVerbs.Get).ShouldMapTo(action); }
public void InBoundUrl_WithNonGetMethod_AndNoParam_IsNotRouted() { var url = new SkinsRouter.SampleRoute().AlternateUrls.Single().ToAppRelativeUrl(); url.WithMethodsExcept(HttpVerbs.Get).ShouldMapToNothing(); }