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); }
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"); }