public void CollectAsyncTest() { var testAsync = EnumeratorUtility.CollectAsync(DoTest_2()); Assert.IsNotNull(testAsync); var testEnum = EnumeratorUtility.Collect(testAsync, state => { if (state == null) { return; } Console.WriteLine(state); }, () => { Console.WriteLine("Conplete"); }); Assert.IsNotNull(testEnum); while (testEnum.MoveNext()) { } }
public void CollectTest1() { var testEnum = EnumeratorUtility.Collect( new IEnumerator[] { DoTest_0(), DoTest_1() }, state => { if (state == null) { return; } Console.WriteLine(state); }, () => { Console.WriteLine("Conplete"); }); Assert.IsNotNull(testEnum); while (testEnum.MoveNext()) { } }