updated unit test to be more complex.

This commit is contained in:
Zaafar 2021-03-19 16:44:24 -04:00
parent 355c3a4f8c
commit 7bff370663
1 changed files with 7 additions and 1 deletions

View File

@ -88,6 +88,8 @@ namespace Tests {
[Test]
public void TestNestedCoroutine() {
var onChildCreated = new Event();
var onParentCreated = new Event();
var myEvent = new Event();
var counterAlwaysRunning = 0;
@ -120,8 +122,12 @@ namespace Tests {
counterGrandParent++;
// Nested corotuine starting.
var p = CoroutineHandler.Start(Parent());
CoroutineHandler.RaiseEvent(onParentCreated);
// Nested corotuine starting in OnFinished.
p.OnFinished += ac => CoroutineHandler.Start(Child());
p.OnFinished += ac => {
CoroutineHandler.Start(Child());
CoroutineHandler.RaiseEvent(onChildCreated);
};
}
CoroutineHandler.Start(AlwaysRunning());