public void Inbound_WithGet_AndNumber0_MapsToNothing() { const int number = 0; var routeUrl = new UpdateEmailValueRouter.GetRoute().Url; const string numberParam = "number"; var urlFormat = routeUrl.Replace(numberParam, "0"); var url = string.Format(urlFormat, number).ToAppRelativeUrl(); url.WithMethod(HttpVerbs.Get).ShouldMapToNothing(); }
public void Inbound_WithNonGetPostOrPut_AndPositiveNumber_MapsToNothing() { const int number = 4; var routeUrl = new UpdateEmailValueRouter.GetRoute().Url; const string numberParam = "number"; var urlFormat = routeUrl.Replace(numberParam, "0"); var url = string.Format(urlFormat, number).ToAppRelativeUrl(); url.WithMethodsExcept(HttpVerbs.Get, HttpVerbs.Put, HttpVerbs.Post).ShouldMapToNothing(); }
public void Outbound_ForGetAction_AndPositiveNumber_MapsToUrl() { const int number = 5; Expression<Func<UpdateEmailValueController, ActionResult>> action = controller => controller.Get(number); var routeUrl = new UpdateEmailValueRouter.GetRoute().Url; const string numberParam = "number"; var urlFormat = routeUrl.Replace(numberParam, "0"); var url = string.Format(urlFormat, number).ToAppRelativeUrl(); OutBoundRoute.Of(action).InArea(AreaName).WithMethod(HttpVerbs.Get).AppRelativeUrl().ShouldEqual(url); }
public void Inbound_WithGet_AndPositiveNumber_MapsToGetAction() { const int number = 1; Expression<Func<UpdateEmailValueController, ActionResult>> action = controller => controller.Get(number); var routeUrl = new UpdateEmailValueRouter.GetRoute().Url; const string numberParam = "number"; var urlFormat = routeUrl.Replace(numberParam, "0"); var url = string.Format(urlFormat, number).ToAppRelativeUrl(); url.WithMethod(HttpVerbs.Get).ShouldMapTo(action); }
public void Outbound_ForGetAction_AndPositiveNumber_MapsToUrl() { const int number = 5; Expression <Func <UpdateEmailValueController, ActionResult> > action = controller => controller.Get(number); var routeUrl = new UpdateEmailValueRouter.GetRoute().Url; const string numberParam = "number"; var urlFormat = routeUrl.Replace(numberParam, "0"); var url = string.Format(urlFormat, number).ToAppRelativeUrl(); OutBoundRoute.Of(action).InArea(AreaName).WithMethod(HttpVerbs.Get).AppRelativeUrl().ShouldEqual(url); }
public void Inbound_WithGet_AndPositiveNumber_MapsToGetAction() { const int number = 1; Expression <Func <UpdateEmailValueController, ActionResult> > action = controller => controller.Get(number); var routeUrl = new UpdateEmailValueRouter.GetRoute().Url; const string numberParam = "number"; var urlFormat = routeUrl.Replace(numberParam, "0"); var url = string.Format(urlFormat, number).ToAppRelativeUrl(); url.WithMethod(HttpVerbs.Get).ShouldMapTo(action); }