Inheritance: UCosmic.Www.Mvc.Controllers.MvcRoute
 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();
            }
 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);
            }
 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();
 }
 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);
 }