Exemple #1
0
        public void create_route_parsing_frame_from_string_argument()
        {
            var arg = new RouteArgument("name", 1);

            arg.ArgType = typeof(string);

            var frame = arg.ToParsingFrame(null).ShouldBeOfType <CastRouteArgumentFrame>();

            frame.ShouldNotBeNull();
            frame.Position.ShouldBe(1);
            frame.Name.ShouldBe("name");
        }
        public void create_route_parsing_frame_from_string_argument()
        {
            var arg = new RouteArgument("name", 1);

            arg.ArgType = typeof(string);

            var frame = arg.ToParsingFrame().ShouldBeOfType <StringRouteArgument>();

            ShouldBeNullExtensions.ShouldNotBeNull(frame);
            frame.Position.ShouldBe(1);
            frame.Name.ShouldBe("name");
        }
Exemple #3
0
        public void create_route_parsing_from_int_argument()
        {
            var arg = new RouteArgument("age", 3)
            {
                ArgType = typeof(int)
            };

            var frame = arg.ToParsingFrame(null).ShouldBeOfType <ParsedRouteArgumentFrame>();

            frame.ShouldNotBeNull();
            frame.Position.ShouldBe(3);
            frame.Variable.Usage.ShouldBe("age");

            frame.Variable.VariableType.ShouldBe(typeof(int));
        }