示例#1
0
 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());
 }
示例#2
0
 public override void setUp()
 {
     result = new TestResult();
 }
示例#3
0
 public void run(TestResult result)
 {
     foreach (ITest test in tests)
     {
         test.run(result);
     }
 }
示例#4
0
 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();
     }
 }