Ejemplo n.º 1
0
		private bool CompileCodeSnippet( fit.Parse cell, string code )
		{
			TestCompiler compiler = new TestCompiler( 
				new string[] { "system.dll", "nunit.framework.dll" }, 
				testAssembly );

			CompilerResults results = compiler.CompileCode( code );
			if ( results.NativeCompilerReturnValue == 0 )
				return true;

			cell.addToBody( "<font size=-1 color=\"#c08080\"><i>Compiler errors</i></font>" );

			wrong( cell );
			cell.addToBody( "<hr>" );
				
			foreach( string line in results.Output )
				cell.addToBody( line + "<br>" );

			return true;
		}
Ejemplo n.º 2
0
		protected void LoadAndRunTestAssembly( fit.Parse cell, string testAssembly )
		{
			testRunner = new TestDomain();

			if ( !testRunner.Load( new TestPackage(testAssembly) ) )
			{
				this.wrong(cell);
				cell.addToBody( string.Format( 
					"<font size=-1 color=\"#c08080\"> <i>Failed to load {0}</i></font>", testAssembly ) );

				return;
			}

			testResult = testRunner.Run(NullListener.NULL);
			testSummary = new ResultSummarizer( testResult );

			this.right( cell );
		}