private ITestComponent FindNextTestGroup(ITestComponent testGroup) { if (testGroup != null) { if (testCollection[testGroup].Any()) { testGroup.EnableTest(true); return(FindInnerTestGroup(testGroup)); } testCollection.Remove(testGroup); testGroup.EnableTest(false); var parentTestGroup = testGroup.GetTestGroup(); if (parentTestGroup == null) { return(null); } testCollection[parentTestGroup].Remove(testGroup); return(FindNextTestGroup(parentTestGroup)); } throw new Exception("No test left"); }
public ITestComponent GetNextTest() { ITestComponent testComponent = testCollection[currentTestGroup].First(); testCollection[currentTestGroup].Remove(testComponent); testComponent.EnableTest(enable: true); return(testComponent); }
public void FinishTest(ITestComponent test) { try { test.EnableTest(false); currentTestGroup = FindNextTestGroup(currentTestGroup); } catch (MissingReferenceException e) { Debug.LogException(e); return; } }
private ITestComponent FindNextTestGroup(ITestComponent testGroup) { if (testGroup == null) throw new Exception ("No test left"); if (testCollection[testGroup].Any()) { testGroup.EnableTest(true); return FindInnerTestGroup(testGroup); } testCollection.Remove(testGroup); testGroup.EnableTest(false); var parentTestGroup = testGroup.GetTestGroup(); if (parentTestGroup == null) return null; testCollection[parentTestGroup].Remove(testGroup); return FindNextTestGroup(parentTestGroup); }
private ITestComponent FindNextTestGroup(ITestComponent testGroup) { if (testGroup == null) { throw new Exception("No test left"); } if (testCollection[testGroup].Any()) { testGroup.EnableTest(enable: true); return(FindInnerTestGroup(testGroup)); } testCollection.Remove(testGroup); testGroup.EnableTest(enable: false); ITestComponent testGroup2 = testGroup.GetTestGroup(); if (testGroup2 == null) { return(null); } testCollection[testGroup2].Remove(testGroup); return(FindNextTestGroup(testGroup2)); }