Inheritance: UCosmic.Www.Mvc.Controllers.MvcRoute
コード例 #1
0
 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);
 }
コード例 #2
0
 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");
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 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);
 }
コード例 #5
0
 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();
 }
コード例 #6
0
 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);
 }
コード例 #7
0
 public void InBoundUrl_WithNonGetMethod_AndNoParam_IsNotRouted()
 {
     var url = new SkinsRouter.SampleRoute().AlternateUrls.Single().ToAppRelativeUrl();
     url.WithMethodsExcept(HttpVerbs.Get).ShouldMapToNothing();
 }