public void Maps2Urls_FirstWithReturnUrl_ThenWithout() { var obj1 = new SupplementalFormsRouter.LocateGetRoute(); var obj2 = new SupplementalFormsRouter.LocateGetWithoutReturnUrlRoute(); obj1.ShouldNotBeNull(); obj2.ShouldNotBeNull(); }
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); }
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); }
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_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); }