Exemplo n.º 1
0
 protected override void Setup(nTestSuite tests)
 {
     tests.type = typeof(MyTests);
       tests.type = typeof(MyTests2);
       tests.type = typeof(nDbRecordTests);
       tests.type = typeof(RecordSerializerTests);
 }
Exemplo n.º 2
0
 protected override void Setup(nTestSuite tests)
 {
     var assembly = typeof(HelloApp).Assembly;
       foreach (var c in assembly.GetTypes()) {
     if (c.IsSubclassOf(typeof(nTestBase)))
       tests.type = c;
       }
 }
Exemplo n.º 3
0
 protected override void Setup(nTestSuite tests)
 {
     #if TEST_ALL
     var assembly = typeof(Pongstar).Assembly;
     foreach (var c in assembly.GetTypes()) {
       if (c.IsSubclassOf(typeof(nTestBase)))
     tests.type = c;
     }
       #else
     tests.type = typeof(nQuadTests);
       #endif
 }
Exemplo n.º 4
0
 /** Run tests for this project with the provider writer */
 public void Run(Type writer)
 {
     var args = Args ();
       if (args.ContainsKey ("testOutputPath")) {
     var path = args ["testOutputPath"];
     var suite = new nTestSuite ();
     Setup (suite);
     RunTests (suite);
     SaveTestResults (path, suite, writer);
       } else {
     throw new Exception("Invalid request: Invoke this using: $UNITY -batchmode -quit -projectPath $PROJECT -executeMethod $METHOD testOutputPath=$OUTPUT");
       }
 }
Exemplo n.º 5
0
 /** Run the tests */
 private void RunTests(nTestSuite suite)
 {
     nTestResultSet item = null;
       while ((item = suite.Next()) != null) {
     var tests = item.Results;
     foreach (var test in tests) {
       try {
     var instance = (nTestBase) Activator.CreateInstance(item.Target);
     instance.Results = test;
     test.Target.Invoke(instance, new object[]{});
       }
       catch(Exception e) {
     test.Error = e;
     test.Success = false;
       }
     }
       }
 }
Exemplo n.º 6
0
 protected override void Setup(nTestSuite tests)
 {
     tests.type = typeof(MyTests);
       tests.type = typeof(MyTests2);
 }
Exemplo n.º 7
0
 /** Save test results */
 private void SaveTestResults(string path, nTestSuite suite, Type writer)
 {
     var instance = (nTestWriter) Activator.CreateInstance(writer);
       instance.Write(path, suite);
 }
Exemplo n.º 8
0
 /** Implement class binding here */
 protected abstract void Setup(nTestSuite tests);