Exemplo n.º 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());
 }
Exemplo n.º 2
0
 public override void setUp()
 {
     result = new TestResult();
 }
Exemplo n.º 3
0
 public void run(TestResult result)
 {
     foreach (ITest test in tests)
     {
         test.run(result);
     }
 }
Exemplo n.º 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();
     }
 }