Пример #1
0
 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");
 }
Пример #2
0
        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");
            }
        }