예제 #1
0
 public void EmptyAssemblyTest()
 {
     var clrCodeGenerator = new ClrCodeGenerator("Output.exe");
     clrCodeGenerator.StartModule("Foo");
     clrCodeGenerator.EndModule();
     clrCodeGenerator.Save(false);
 }
예제 #2
0
 ClrCodeGenerator GetGeneratorForStatement()
 {
     string name = "Output_" + Guid.NewGuid().ToString("N") + ".exe";
     var clrCodeGenerator = new ClrCodeGenerator(name);
     clrCodeGenerator.StartModule("Foo");
     return clrCodeGenerator;
 }
예제 #3
0
        private object GetStatementResult(ClrCodeGenerator clrCodeGenerator)
        {
            clrCodeGenerator.EndModule();
            Assembly a = clrCodeGenerator.Save(false);

            Type foo = a.GetType("Foo");
            MethodInfo main = foo.GetMethod("Test");

            return main.Invoke(null, null);
        }
예제 #4
0
 private Assembly GetResult(ClrCodeGenerator clrCodeGenerator)
 {
     return clrCodeGenerator.Save(false);
 }
예제 #5
0
 ClrCodeGenerator GetGenerator()
 {
     string name = "Output_" + Guid.NewGuid().ToString("N") + ".exe";
     var clrCodeGenerator = new ClrCodeGenerator(name);
     return clrCodeGenerator;
 }
예제 #6
0
 private void EndIfTestGeneration(ClrCodeGenerator clrCodeGenerator)
 {
     clrCodeGenerator.Return("a");
     clrCodeGenerator.EndMethod();
     clrCodeGenerator.EndModule();
 }