Exemplo n.º 1
0
 public void SetMethodTwice()
 {
     Reduction r = new Reduction("return 42;");
     MethodInfo m = typeof(TestReduction).GetMethod("SetMethodTwice");
     r.SetCompiledMethod(m);
     r.SetCompiledMethod(m);
 }
Exemplo n.º 2
0
 public void SetNullCompiledMethod()
 {
     Reduction r = new Reduction("return \"hi\";");
     r.SetCompiledMethod(null);
 }
Exemplo n.º 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));
 }