/// <summary> /// Runs all test as coroutine. /// </summary> /// <param name="testClasses">The list of test classes.</param> /// <param name="resultPrefab">The prefab for test result indicators.</param> /// <param name="resultVertical">The vertical area which test result indicators to be belonging.</param> /// <returns><see cref="IEnumerator"/> for coroutine.</returns> private static IEnumerator RunAllTestCoroutine(IEnumerable <TestClass> testClasses, Result resultPrefab, GameObject resultVertical) { var sumaryReporter = new TestSummaryReporter("All tests", true, resultPrefab, resultVertical); foreach (var testClass in testClasses) { sumaryReporter.SetCurrentTestClassName(testClass.Name); var enumerator = RuntTestCoroutineCore(testClass, sumaryReporter, resultPrefab, resultVertical); try { while (enumerator.MoveNext()) { yield return(enumerator.Current); } } finally { var asDisposable = enumerator as IDisposable; if (asDisposable != null) { asDisposable.Dispose(); } } yield return(null); } }
/// <summary> /// Runs all test as coroutine. /// </summary> /// <param name="testClasses">The list of test classes.</param> /// <param name="resultPrefab">The prefab for test result indicators.</param> /// <param name="resultVertical">The vertical area which test result indicators to be belonging.</param> /// <returns><see cref="IEnumerator"/> for coroutine.</returns> private static IEnumerator RunAllTestCoroutine( IEnumerable<TestClass> testClasses, Result resultPrefab, GameObject resultVertical ) { var sumaryReporter = new TestSummaryReporter( "All tests", true, resultPrefab, resultVertical ); foreach ( var testClass in testClasses ) { sumaryReporter.SetCurrentTestClassName( testClass.Name ); var enumerator = RuntTestCoroutineCore( testClass, sumaryReporter, resultPrefab, resultVertical ); try { while ( enumerator.MoveNext() ) { yield return enumerator.Current; } } finally { var asDisposable = enumerator as IDisposable; if ( asDisposable != null ) { asDisposable.Dispose(); } } yield return null; } }