public void Build_should_return_route_with_ListRange_as_input_type()
        {
            var type = typeof(ListingHandler<StubViewModel, StubEntity>);
            var policy = new ListingHandlerUrlPolicy();
            var action = new ActionCall(type, type.GetMethod("Retrieve"));

            var route = policy.Build(action);

            Assert.AreEqual(typeof(ListingOf<StubViewModel>), route.Input.InputType);
        }
        public void Build_should_return_route_with_view_model_name_as_url_without_ViewModel()
        {
            var type = typeof(ListingHandler<StubViewModel, StubEntity>);
            var policy = new ListingHandlerUrlPolicy();
            var action = new ActionCall(type, type.GetMethod("Retrieve"));

            var route = policy.Build(action);

            Assert.AreEqual("stubes", route.Pattern);
        }
        public void Build_should_return_route_constrained_to_GET_verb()
        {
            var type = typeof(ListingHandler<StubViewModel, StubEntity>);
            var policy = new ListingHandlerUrlPolicy();
            var action = new ActionCall(type, type.GetMethod("Retrieve"));

            var route = policy.Build(action);

            Assert.AreEqual(1, route.AllowedHttpMethods.Count);
            CollectionAssert.Contains(route.AllowedHttpMethods, "GET");
        }