You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One thing you might've noticed is that instead of calling StartCoroutine on a MonoBehaviour,
83
+
we're calling it on the ICoroutineRunner interface. This allows us to mock the runner in our tests.
85
84
86
85
The Counter can now be tested as follows:
87
86
@@ -96,7 +95,7 @@ The Counter can now be tested as follows:
96
95
Assert.AreEqual(1, Counter.Current);
97
96
```
98
97
99
-
Calling Runner.MoveNext() will simulate Unity's coroutine update loop.
98
+
Calling `Runner.MoveNext()` will simulate Unity's coroutine update loop.
100
99
101
100
You can check the [CounterTests.cs](https://github.com/AAulicino/Unity-Coroutines-for-NSubstitute/blob/main/Tests/Editor/Samples/Counter/CounterTests.cs)
102
101
for test examples on the [Counter](https://github.com/AAulicino/Unity-Coroutines-for-NSubstitute/blob/main/Tests/Editor/Samples/Counter/Counter.cs) class.
@@ -105,20 +104,13 @@ Since MonoBehaviours implement all methods specified in the ICoroutineRunner int
0 commit comments