public void InBoundUrl_WithNonPutAndPostMethods_IsNotRouted() { var model = new RoleForm { EntityId = Guid.NewGuid() }; var url = new RolesRouter.PutRoute().Url.ToAppRelativeUrl() .Replace("{entityId}", model.EntityId.ToString()); url.WithMethodsExcept(HttpVerbs.Put, HttpVerbs.Post).ShouldMapToNothing(); }
public void OutBoundUrl_IsNotRouted() { var model = new RoleForm { EntityId = Guid.NewGuid() }; Expression<Func<RolesController, ActionResult>> action = controller => controller.Put(model); var url = new RolesRouter.PutRoute().Url.ToAppRelativeUrl() .Replace("{entityId}", model.EntityId.ToString()); OutBoundRoute.Of(action).InArea(Area).AppRelativeUrl().ShouldNotEqual(url); }
public void InBoundUrl_WithPutAndPostMethods_IsRouted() { var model = new RoleForm { EntityId = Guid.NewGuid() }; Expression<Func<RolesController, ActionResult>> action = controller => controller.Put(model); var url = new RolesRouter.PutRoute().Url.ToAppRelativeUrl() .Replace("{entityId}", model.EntityId.ToString()); url.WithMethod(HttpVerbs.Put).AndMethodArg("model", model).ShouldMapTo(action); url.WithMethod(HttpVerbs.Post).AndMethodArg("model", model).ShouldMapTo(action); }
public void OutBoundUrl_IsNotRouted() { var model = new RoleForm { EntityId = Guid.NewGuid() }; Expression <Func <RolesController, ActionResult> > action = controller => controller.Put(model); var url = new RolesRouter.PutRoute().Url.ToAppRelativeUrl() .Replace("{entityId}", model.EntityId.ToString()); OutBoundRoute.Of(action).InArea(Area).AppRelativeUrl().ShouldNotEqual(url); }
public void InBoundUrl_WithPutAndPostMethods_IsRouted() { var model = new RoleForm { EntityId = Guid.NewGuid() }; Expression <Func <RolesController, ActionResult> > action = controller => controller.Put(model); var url = new RolesRouter.PutRoute().Url.ToAppRelativeUrl() .Replace("{entityId}", model.EntityId.ToString()); url.WithMethod(HttpVerbs.Put).AndMethodArg("model", model).ShouldMapTo(action); url.WithMethod(HttpVerbs.Post).AndMethodArg("model", model).ShouldMapTo(action); }