Inheritance: UCosmic.Www.Mvc.Controllers.MvcRoute
Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 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);
 }
Esempio n. 3
0
 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);
 }
Esempio n. 4
0
            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();
            }
Esempio n. 5
0
            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);
            }
Esempio n. 6
0
            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);
            }