예제 #1
0
 static void testIntForNull()
 {
     var obj = new NullableTestClass();
     obj.NullableInt = 4;
     System.Console.WriteLine($"NullableIntSetToNull? {TestSetOfValue("NullableInt", null, obj)}");
 }
예제 #2
0
 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;
 }