public void got_to_have_a_route_name()
        {
            var chain = new RoutedChain("foo");
            //chain.RouteName = "bar";
            chain.Route.AddHttpMethodConstraint("PUT");

            var router = new MyJavascriptRouter();
            Exception<ArgumentOutOfRangeException>.ShouldBeThrownBy(() => {
                router.Add(chain);
            });
        }
Exemplo n.º 2
0
        public void got_to_have_a_route_name()
        {
            var chain = new RoutedChain("foo");

            //chain.RouteName = "bar";
            chain.Route.AddHttpMethodConstraint("PUT");

            var router = new MyJavascriptRouter();

            Exception <ArgumentOutOfRangeException> .ShouldBeThrownBy(() => {
                router.Add(chain);
            });
        }
        public void add_route_happy_path()
        {
            var chain = new RoutedChain("foo");
            chain.RouteName = "bar";
            chain.Route.AddHttpMethodConstraint("PUT");

            var router = new MyJavascriptRouter();
            router.Add(chain);

            var route = router.Routes().Single();

            route.Name.ShouldBe("bar");
            route.Method.ShouldBe("PUT");
            route.Finder(null).ShouldBeTheSameAs(chain);
        }
Exemplo n.º 4
0
        public void add_route_happy_path()
        {
            var chain = new RoutedChain("foo");

            chain.RouteName = "bar";
            chain.Route.AddHttpMethodConstraint("PUT");

            var router = new MyJavascriptRouter();

            router.Add(chain);

            var route = router.Routes().Single();

            route.Name.ShouldBe("bar");
            route.Method.ShouldBe("PUT");
            route.Finder(null).ShouldBeTheSameAs(chain);
        }