mirror of
https://github.com/Ellpeck/Coroutine.git
synced 2024-11-24 14:18:34 +01:00
updated unit test to be more complex.
This commit is contained in:
parent
355c3a4f8c
commit
7bff370663
1 changed files with 7 additions and 1 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue