Ejemplo n.º 1
0
        public void FindsIGetTypeWhereIGetIsOnBaseClass()
        {
            var builder = new RoutingTableBuilder(typeof(IGet));
            var table   = builder.BuildRoutingTable();

            Assert.Contains(typeof(Bar), table.GetAllTypes());
        }
Ejemplo n.º 2
0
        public void FindsIGetType()
        {
            var builder = new RoutingTableBuilder(typeof(IGet));
            var table   = builder.BuildRoutingTable();

            Assert.Contains(typeof(GetFoo), table.GetAllTypes());
        }
Ejemplo n.º 3
0
        public void FindsGenericHandlerUsingConstraints()
        {
            var builder = new RoutingTableBuilder(typeof(IGet));
            var table   = builder.BuildRoutingTable();

            Assert.Contains(typeof(GetThingConstraint <Entity>), table.GetAllTypes());
            Assert.Contains(typeof(GetThingConstraint <Exorcist>), table.GetAllTypes());
        }
Ejemplo n.º 4
0
        public void FindsGetWithUltimateBaseClassNoInterface()
        {
            var builder = new RoutingTableBuilder(typeof(IGetAsync));
            var table   = builder.BuildRoutingTable();
            IDictionary <string, string> variables;
            var actual = table.Get("/top/bottom", out variables, "", new string[0]);

            Assert.Equal(typeof(Bottom), actual);
        }
Ejemplo n.º 5
0
        public void FiltersHandlerByNoContentType()
        {
            var builder = new RoutingTableBuilder(typeof(IGet));
            var table   = builder.BuildRoutingTable();
            IDictionary <string, string> variables;
            var actual = table.Get("/spaceship", out variables);

            Assert.Equal(typeof(GetSpaceship), actual);
        }
Ejemplo n.º 6
0
        public void FindsGenericHandlerUsingRegexResolver()
        {
            var builder     = new RoutingTableBuilder(typeof(IGet));
            var table       = builder.BuildRoutingTable();
            var actualTypes = table.GetAllTypes().ToArray();

            Assert.Contains(typeof(GetThingRegex <Entity>), actualTypes);
            Assert.Contains(typeof(GetThingRegex <Exorcist>), actualTypes);
        }