public void Inbound_WithPut_AndEstablishmentId0_MapsToNothing() { const int establishmentId = 0; var routeUrl = new UpdateAffiliationRouter.PutRoute().Url; const string establishmentIdParam = "establishmentId"; var urlFormat = routeUrl.Replace(establishmentIdParam, "0"); var url = string.Format(urlFormat, establishmentId).ToAppRelativeUrl(); url.WithMethod(HttpVerbs.Put).ShouldMapToNothing(); }
public void Inbound_WithPost_AndPositiveEstablishmentId_MapsToPutAction() { const int establishmentId = 3; Expression <Func <UpdateAffiliationController, ActionResult> > action = controller => controller.Put(null); var routeUrl = new UpdateAffiliationRouter.PutRoute().Url; const string establishmentIdParam = "establishmentId"; var urlFormat = routeUrl.Replace(establishmentIdParam, "0"); var url = string.Format(urlFormat, establishmentId).ToAppRelativeUrl(); url.WithMethod(HttpVerbs.Post).ShouldMapTo(action); }
public void Outbound_ForPutAction_AndPositiveEstablishmentId_MapsToUrl() { const int establishmentId = 6; Expression <Func <UpdateAffiliationController, ActionResult> > action = controller => controller.Put(null); var routeUrl = new UpdateAffiliationRouter.PutRoute().Url; const string establishmentIdParam = "establishmentId"; var urlFormat = routeUrl.Replace(establishmentIdParam, "0"); var url = string.Format(urlFormat, establishmentId).ToAppRelativeUrl(); OutBoundRoute.Of(action).InArea(AreaName).WithMethod(HttpVerbs.Post) .HavingViewModelProperty(establishmentIdParam, establishmentId).AppRelativeUrl().ShouldEqual(url); }
public void Outbound_ForPutAction_AndPositiveEstablishmentId_MapsToUrl() { const int establishmentId = 6; Expression<Func<UpdateAffiliationController, ActionResult>> action = controller => controller.Put(null); var routeUrl = new UpdateAffiliationRouter.PutRoute().Url; const string establishmentIdParam = "establishmentId"; var urlFormat = routeUrl.Replace(establishmentIdParam, "0"); var url = string.Format(urlFormat, establishmentId).ToAppRelativeUrl(); OutBoundRoute.Of(action).InArea(AreaName).WithMethod(HttpVerbs.Post) .HavingViewModelProperty(establishmentIdParam, establishmentId).AppRelativeUrl().ShouldEqual(url); }
public void Inbound_WithPost_AndPositiveEstablishmentId_MapsToPutAction() { const int establishmentId = 3; Expression<Func<UpdateAffiliationController, ActionResult>> action = controller => controller.Put(null); var routeUrl = new UpdateAffiliationRouter.PutRoute().Url; const string establishmentIdParam = "establishmentId"; var urlFormat = routeUrl.Replace(establishmentIdParam, "0"); var url = string.Format(urlFormat, establishmentId).ToAppRelativeUrl(); url.WithMethod(HttpVerbs.Post).ShouldMapTo(action); }