protected override void Setup(nTestSuite tests)
 {
     tests.type = typeof(MyTests);
       tests.type = typeof(MyTests2);
       tests.type = typeof(nDbRecordTests);
       tests.type = typeof(RecordSerializerTests);
 }
 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;
       }
 }
Exemple #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
 }
 /** 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");
       }
 }
 /** 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;
       }
     }
       }
 }
Exemple #6
0
 protected override void Setup(nTestSuite tests)
 {
     tests.type = typeof(MyTests);
       tests.type = typeof(MyTests2);
 }
 /** Save test results */
 private void SaveTestResults(string path, nTestSuite suite, Type writer)
 {
     var instance = (nTestWriter) Activator.CreateInstance(writer);
       instance.Write(path, suite);
 }
 /** Implement class binding here */
 protected abstract void Setup(nTestSuite tests);