From 7bff370663f58266288ed07bd11dbbcb50e3fd01 Mon Sep 17 00:00:00 2001 From: Zaafar Date: Fri, 19 Mar 2021 16:44:24 -0400 Subject: [PATCH] updated unit test to be more complex. --- Tests/EventBasedCoroutineTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/EventBasedCoroutineTests.cs b/Tests/EventBasedCoroutineTests.cs index c8fd3c7..5c5cb72 100644 --- a/Tests/EventBasedCoroutineTests.cs +++ b/Tests/EventBasedCoroutineTests.cs @@ -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());