1 // ****************************************************************
\r
2 // Copyright 2007, Charlie Poole
\r
3 // This is free software licensed under the NUnit license. You may
\r
4 // obtain a copy of the license at http://nunit.org/?p=license&r=2.4
\r
5 // ****************************************************************
\r
10 using System.Collections;
\r
14 namespace NUnit.Fixtures
\r
17 /// Abstract base class for fixtures that load and run a test assembly.
\r
19 public abstract class TestLoadFixture : fit.ColumnFixture
\r
21 protected TestRunner testRunner;
\r
22 protected TestResult testResult;
\r
23 protected ResultSummarizer testSummary;
\r
25 protected void LoadAndRunTestAssembly( fit.Parse cell, string testAssembly )
\r
27 testRunner = new TestDomain();
\r
29 if ( !testRunner.Load( new TestPackage(testAssembly) ) )
\r
32 cell.addToBody( string.Format(
\r
33 "<font size=-1 color=\"#c08080\"> <i>Failed to load {0}</i></font>", testAssembly ) );
\r
38 testResult = testRunner.Run(NullListener.NULL);
\r
39 testSummary = new ResultSummarizer( testResult );
\r
44 public override void wrong(fit.Parse cell)
\r
46 string body = cell.body;
\r
51 public int Skipped()
\r
53 return testRunner.Test.TestCount - testSummary.ResultCount - testSummary.IgnoreCount;
\r
58 return testRunner.Test.TestCount;
\r
63 return testSummary.ResultCount;
\r
66 public int Failures()
\r
68 return testSummary.FailureCount;
\r
71 public int Ignored()
\r
73 return testSummary.IgnoreCount;
\r