diff --git a/VContainer/Assets/VContainer/Tests/Unity/EntryPointTest.cs b/VContainer/Assets/VContainer/Tests/Unity/EntryPointTest.cs index a4c72ef7..6f25e470 100644 --- a/VContainer/Assets/VContainer/Tests/Unity/EntryPointTest.cs +++ b/VContainer/Assets/VContainer/Tests/Unity/EntryPointTest.cs @@ -1,5 +1,6 @@ using System.Collections; using NUnit.Framework; +using UnityEngine; using UnityEngine.TestTools; using VContainer.Unity; @@ -16,8 +17,6 @@ public IEnumerator Create() builder.Register(Lifetime.Scoped); }); - yield return null; - yield return null; yield return null; var entryPoint = lifetimeScope.Container.Resolve(); @@ -28,6 +27,11 @@ public IEnumerator Create() Assert.That(entryPoint.StartCalled, Is.EqualTo(1)); Assert.That(entryPoint.PostStartCalled, Is.EqualTo(1)); + yield return new WaitForFixedUpdate(); + + Assert.That(entryPoint.FixedTickCalls, Is.GreaterThan(0)); + Assert.That(entryPoint.PostFixedTickCalls, Is.GreaterThan(0)); + var fixedTickCalls = entryPoint.FixedTickCalls; var postFixedTickCalls = entryPoint.PostFixedTickCalls; var tickCalls = entryPoint.TickCalls; @@ -38,23 +42,16 @@ public IEnumerator Create() var disposable = lifetimeScope.Container.Resolve(); lifetimeScope.Dispose(); - Assert.That(fixedTickCalls, Is.GreaterThan(0)); - Assert.That(postFixedTickCalls, Is.GreaterThan(0)); - Assert.That(tickCalls, Is.GreaterThan(1)); - Assert.That(postTickCalls, Is.GreaterThan(1)); - Assert.That(lateTickCalls, Is.GreaterThan(1)); - Assert.That(postLateTickCalls, Is.GreaterThan(1)); - - yield return null; yield return null; + yield return new WaitForFixedUpdate(); + Assert.That(fixedTickCalls, Is.EqualTo(fixedTickCalls)); + Assert.That(postFixedTickCalls, Is.EqualTo(postFixedTickCalls)); + Assert.That(tickCalls, Is.EqualTo(tickCalls)); + Assert.That(postTickCalls, Is.EqualTo(postTickCalls)); + Assert.That(lateTickCalls, Is.EqualTo(lateTickCalls)); + Assert.That(postLateTickCalls, Is.EqualTo(postLateTickCalls)); Assert.That(disposable.Disposed, Is.True); - Assert.That(entryPoint.FixedTickCalls, Is.EqualTo(fixedTickCalls)); - Assert.That(entryPoint.PostFixedTickCalls, Is.EqualTo(postFixedTickCalls)); - Assert.That(entryPoint.TickCalls, Is.EqualTo(tickCalls)); - Assert.That(entryPoint.PostTickCalls, Is.EqualTo(postTickCalls)); - Assert.That(entryPoint.LateTickCalls, Is.EqualTo(lateTickCalls)); - Assert.That(entryPoint.PostLateTickCalls, Is.EqualTo(postLateTickCalls)); } [UnityTest]