public void TestCodeDriver() { var driver = new CodeDriver(); bool isError; string input = "System.Text.StringBuilder sb = new System.Text.StringBuilder();" + "for (int i = 0; i < 5; i++)" + "sb.Append(i.ToString());" + "Console.WriteLine(sb.ToString());"; string output = driver.CompileAndRun(input, out isError); }
public void TestAppDomain() { AppDomain codeDomain = AppDomain.CreateDomain("CodeDriver"); CodeDriver codeDriver = (CodeDriver)codeDomain.CreateInstanceAndUnwrap("CSharpProfessional", "CSharpProfessional.Part1.CodeDriver"); bool isError; string input = "System.Text.StringBuilder sb = new System.Text.StringBuilder();" + "for (int i = 0; i < 5; i++)" + "sb.Append(i.ToString());" + "Console.WriteLine(sb.ToString());"; string result = codeDriver.CompileAndRun(input, out isError); AppDomain.Unload(codeDomain); }