Example #1
0
        public void write_value_to_property()
        {
            var arg = new RouteArgument("Color", 2);

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

            var model = new InputModel();
            var dict  = new Dictionary <string, object>();

            dict.Add("Color", Color.Yellow);

            arg.ApplyRouteDataToInput(model, dict);

            model.Color.ShouldBe(Color.Yellow);
        }
Example #2
0
        public void write_value_to_field()
        {
            var arg = new RouteArgument("Key", 0);

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

            var model = new InputModel();
            var dict  = new Dictionary <string, object>();

            dict.Add(arg.Key, "Mat");

            arg.ApplyRouteDataToInput(model, dict);

            model.Key.ShouldBe("Mat");
        }