Beispiel #1
0
        public void Ctor_SetsActionsDataToken()
        {
            var actions = new ReflectedHttpActionDescriptor[0];

            var route = new HttpDirectRoute("route", actions);

            Assert.Equal(actions, route.Actions);
        }
        public void Ctor_SetsActionsDataToken()
        {
            var actions = new ReflectedHttpActionDescriptor[0];

            var route = new HttpDirectRoute("route", 0, actions);

            Assert.Equal(actions, route.Actions);
        }
        public void GetRouteData_AddsDefaultValuesAsNull()
        {
            var actions = new ReflectedHttpActionDescriptor[] { new ReflectedHttpActionDescriptor() };
            var route = new HttpDirectRoute("movies/{id}", 0, actions);
            route.Defaults.Add("id", RouteParameter.Optional);

            var routeData = route.GetRouteData("", new HttpRequestMessage(HttpMethod.Get, "http://localhost/movies"));

            Assert.Null(routeData.Values["id"]);
        }
Beispiel #4
0
        public void GetRouteData_AddsDefaultValuesAsNull()
        {
            var actions = new ReflectedHttpActionDescriptor[] { new ReflectedHttpActionDescriptor() };
            var route   = new HttpDirectRoute("movies/{id}", actions);

            route.Defaults.Add("id", RouteParameter.Optional);

            var routeData = route.GetRouteData("", new HttpRequestMessage(HttpMethod.Get, "http://localhost/movies"));

            Assert.Null(routeData.Values["id"]);
        }