Inheritance: UCosmic.Www.Mvc.Controllers.MvcRoute
コード例 #1
0
 public void Maps2Urls_FirstWithReturnUrl_ThenWithout()
 {
     var obj1 = new SupplementalFormsRouter.LocateGetRoute();
     var obj2 = new SupplementalFormsRouter.LocateGetWithoutReturnUrlRoute();
     obj1.ShouldNotBeNull();
     obj2.ShouldNotBeNull();
 }
コード例 #2
0
            public void Maps2Urls_FirstWithReturnUrl_ThenWithout()
            {
                var obj1 = new SupplementalFormsRouter.LocateGetRoute();
                var obj2 = new SupplementalFormsRouter.LocateGetWithoutReturnUrlRoute();

                obj1.ShouldNotBeNull();
                obj2.ShouldNotBeNull();
            }
コード例 #3
0
            public void InBoundUrl_WithNonGetMethod_AndCatchall_IsNotRouted()
            {
                var          establishmentId = Guid.NewGuid();
                const string attemptedUrl    = "path/to/action";
                var          url             = new SupplementalFormsRouter.LocateGetRoute().Url.ToAppRelativeUrl()
                                               .Replace("{*returnUrl}", attemptedUrl)
                                               .Replace("{establishmentId}", establishmentId.ToString());

                url.WithMethodsExcept(HttpVerbs.Get).ShouldMapToNothing();
            }
コード例 #4
0
 public void OutBoundUrl_OfActionWithNonNullReturnUrl_IsRoutedTo_UrlWithCatchall()
 {
     var establishmentId = Guid.NewGuid();
     const string attemptedUrl = "path/to/action";
     Expression<Func<SupplementalFormsController, ActionResult>> action =
        controller => controller.Locate(establishmentId, attemptedUrl);
     var url = new SupplementalFormsRouter.LocateGetRoute().Url.ToAppRelativeUrl()
         .Replace("{*returnUrl}", attemptedUrl)
         .Replace("{establishmentId}", establishmentId.ToString());
     OutBoundRoute.Of(action).InArea(Area).AppRelativeUrl().ShouldEqual(url);
 }
コード例 #5
0
            public void OutBoundUrl_OfActionWithNonNullReturnUrl_IsRoutedTo_UrlWithCatchall()
            {
                var          establishmentId = Guid.NewGuid();
                const string attemptedUrl    = "path/to/action";
                Expression <Func <SupplementalFormsController, ActionResult> > action =
                    controller => controller.Locate(establishmentId, attemptedUrl);
                var url = new SupplementalFormsRouter.LocateGetRoute().Url.ToAppRelativeUrl()
                          .Replace("{*returnUrl}", attemptedUrl)
                          .Replace("{establishmentId}", establishmentId.ToString());

                OutBoundRoute.Of(action).InArea(Area).AppRelativeUrl().ShouldEqual(url);
            }
コード例 #6
0
            public void InBoundUrl_WithGetMethod_AndCatchall_IsRoutedTo_ActionWithCatchallArg()
            {
                var          establishmentId = Guid.NewGuid();
                const string attemptedUrl    = "path/to/action";
                Expression <Func <SupplementalFormsController, ActionResult> > action =
                    controller => controller.Locate(establishmentId, attemptedUrl);
                var url = new SupplementalFormsRouter.LocateGetRoute().Url.ToAppRelativeUrl()
                          .Replace("{*returnUrl}", attemptedUrl)
                          .Replace("{establishmentId}", establishmentId.ToString());

                url.WithMethod(HttpVerbs.Get).ShouldMapTo(action);
            }
コード例 #7
0
 public void InBoundUrl_WithNonGetMethod_AndCatchall_IsNotRouted()
 {
     var establishmentId = Guid.NewGuid();
     const string attemptedUrl = "path/to/action";
     var url = new SupplementalFormsRouter.LocateGetRoute().Url.ToAppRelativeUrl()
         .Replace("{*returnUrl}", attemptedUrl)
         .Replace("{establishmentId}", establishmentId.ToString());
     url.WithMethodsExcept(HttpVerbs.Get).ShouldMapToNothing();
 }
コード例 #8
0
 public void InBoundUrl_WithGetMethod_AndCatchall_IsRoutedTo_ActionWithCatchallArg()
 {
     var establishmentId = Guid.NewGuid();
     const string attemptedUrl = "path/to/action";
     Expression<Func<SupplementalFormsController, ActionResult>> action =
        controller => controller.Locate(establishmentId, attemptedUrl);
     var url = new SupplementalFormsRouter.LocateGetRoute().Url.ToAppRelativeUrl()
         .Replace("{*returnUrl}", attemptedUrl)
         .Replace("{establishmentId}", establishmentId.ToString());
     url.WithMethod(HttpVerbs.Get).ShouldMapTo(action);
 }