Inheritance: UCosmic.Www.Mvc.Controllers.MvcRoute
コード例 #1
0
            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();
            }
コード例 #2
0
            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();
            }
コード例 #3
0
            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();
            }
コード例 #4
0
            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();
            }
コード例 #5
0
            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);
            }
コード例 #6
0
            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);
            }
コード例 #7
0
            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);
            }
コード例 #8
0
            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);
            }