static void Main(string[] args) { TestSuite suite = new TestSuite(); suite.add(TestCase.CreateSuite(typeof(TestCaseTest))); suite.add(TestCase.CreateSuite(typeof(AssertTest))); TestResult result = new TestResult(); suite.run(result); Console.WriteLine(result.summary()); }
public override void setUp() { result = new TestResult(); }
public void run(TestResult result) { foreach (ITest test in tests) { test.run(result); } }
public void run(TestResult result) { result.testStarted(); this.setUp(); Type type = this.GetType(); MethodInfo methodInfo = type.GetMethod(name, BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.Public); try { methodInfo.Invoke(this, null); } catch (Exception) { result.testFailed(); } finally { this.tearDown(); } }