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