public void CodeShouldNotCompile(string fragment) { string code = template1.Replace("$FRAGMENT$", fragment); TestCompiler compiler = new TestCompiler( new string[] { "system.dll", "nunit.framework.dll" }, "test.dll"); CompilerResults results = compiler.CompileCode(code); if (results.NativeCompilerReturnValue == 0) Assert.Fail("Code fragment \"" + fragment + "\" should not compile but it did"); }
public void CodeShouldNotCompileAsFinishedConstraint(string fragment) { string code = template2.Replace("$FRAGMENT$", fragment); TestCompiler compiler = new TestCompiler( new string[] { "system.dll", "nunit.framework.dll" }, "test.dll"); CompilerResults results = compiler.CompileCode(code); if (results.NativeCompilerReturnValue == 0) { Assert.Fail("Code fragment \"" + fragment + "\" should not compile as a finished constraint but it did"); } }