示例#1
0
 public void SetMethodTwice()
 {
     Reduction r = new Reduction("return 42;");
     MethodInfo m = typeof(TestReduction).GetMethod("SetMethodTwice");
     r.SetCompiledMethod(m);
     r.SetCompiledMethod(m);
 }
示例#2
0
 public void SetNullCompiledMethod()
 {
     Reduction r = new Reduction("return \"hi\";");
     r.SetCompiledMethod(null);
 }
示例#3
0
 public void SetCompiledMethod()
 {
     Reduction r = new Reduction("return \"hi\";");
     r.SetCompiledMethod(typeof(TestReduction).GetMethod("MyMethod", BindingFlags.Static | BindingFlags.Public));
     Assert.AreEqual("there", r.Apply(null));
 }