public void Test_Trivial_String_Props(string propName) { var queryParams = new RoomQueryParamsModel(); var prop = queryParams.GetType().GetProperty(propName); prop.SetValue(queryParams, "test"); Assert.Equal("test", prop.GetValue(queryParams)); }
public void Test_Clamped_Props_Int(string propName, int min, int max) { var queryParams = new RoomQueryParamsModel(); var prop = queryParams.GetType().GetProperty(propName); prop.SetValue(queryParams, -99999999); Assert.Equal(min, prop.GetValue(queryParams)); if (min != max) { prop.SetValue(queryParams, 99999999); Assert.Equal(max, prop.GetValue(queryParams)); } }