public void CannotCompile() { CompilerSettings s = new CompilerSettings(); VBCompiler c = new VBCompiler(s); ICompilerResults cr = c.CompileFiles(new string[] { @"..\..\etc\testdata\compiler\compile_fail.cs" }); Assert.False(cr.Success); string formatted_erros = cr.GetFormattedErrors(); Assert.True(formatted_erros.Contains("compile_fail.cs(5,0)")); }
public void Compile() { CompilerSettings s = new CompilerSettings(); CSharpCompiler c = new CSharpCompiler(s); ICompilerResults cr = c.CompileFiles(new string[] { @"..\..\etc\testdata\compiler\compile_ok.cs" }); Assert.True(cr.Success); Assembly a = cr.GetCompiledAssemblies().First(); Type t = a.GetType("QCV.Test.TestCompilation"); Assert.NotNull(t); object o = Activator.CreateInstance(t); Assert.NotNull(o); object result = t.GetMethod("GetString").Invoke(o, null); Assert.NotNull(result); Assert.AreEqual("Compilation Succeeded", result as string); }
/// <summary> /// Initializes a new instance of the AggregateCompiler class. /// </summary> /// <param name="settings">Settings to pass to each registered compiler.</param> public AggregateCompiler(CompilerSettings settings) : base(settings) { }
/// <summary> /// Initializes a new instance of the CompilerBase class. /// </summary> /// <param name="settings">The settings for compilation</param> public CompilerBase(CompilerSettings settings) { _settings = settings; }
public void CanCompile() { CompilerSettings s = new CompilerSettings(); CSharpCompiler c = new CSharpCompiler(s); Assert.True(c.CanCompileFile(@"..\..\etc\testdata\compiler\compile_ok.cs")); }