static void testIntForNull() { var obj = new NullableTestClass(); obj.NullableInt = 4; System.Console.WriteLine($"NullableIntSetToNull? {TestSetOfValue("NullableInt", null, obj)}"); }
public static bool TestSetOfValue(string property, object value, NullableTestClass obj = null) { obj = obj ?? new NullableTestClass(); var setMethod = Compiler.SetMethod(obj); var getMethod = Compiler.GetMethod(obj); setMethod(obj, property, value); var currentValue = getMethod(obj, property); return currentValue == value; }