예제 #1
0
        public void get_parameters_from_property()
        {
            var arg = new RouteArgument("Key", 0);

            arg.MapToProperty <InputModel>(x => x.Color);


            arg.ReadRouteDataFromInput(new InputModel {
                Color = Color.Blue
            })
            .ShouldBe("Blue");
        }
예제 #2
0
        public void get_parameters_from_number_field()
        {
            var arg = new RouteArgument("Key", 0);

            arg.MapToField <InputModel>("Number");

            arg.ArgType.ShouldBe(typeof(int));

            arg.ReadRouteDataFromInput(new InputModel {
                Number = 25
            })
            .ShouldBe("25");
        }
예제 #3
0
        public void get_parameters_from_field()
        {
            var arg = new RouteArgument("Key", 0);

            arg.MapToField <InputModel>("Key");

            arg.ArgType.ShouldBe(typeof(string));

            arg.ReadRouteDataFromInput(new InputModel {
                Key = "Rand"
            })
            .ShouldBe("Rand");
        }