public void WaitForCoroutineMethod_ContainsCorrectDescription() { var instruction = Responsibly .WaitForCoroutineMethod(this.ThrowImmediately) .ExpectWithinSeconds(1) .ToYieldInstruction(this.Executor); Assert.IsTrue(instruction.CompletedWithError); StringAssert.Contains("ThrowImmediately (Coroutine)", instruction.Error.Message); }
public void WaitForCoroutine_ThrowsWithInvalidExecutor() { var nonUnityExecutor = new TestInstructionExecutor(new MockTestScheduler()); var instruction = Responsibly .WaitForCoroutineMethod(this.Forever) .ExpectWithinSeconds(1) .ToYieldInstruction(nonUnityExecutor); Assert.IsTrue(instruction.CompletedWithError); StringAssert.Contains(nameof(MonoBehaviour), instruction.Error.Message); }
public IEnumerator CompoundCoroutineWait_ContainsCorrectDescription() { var instruction = Responsibly .WaitForCoroutineMethod(this.CompleteAfterOneFrame) .AndThen(Responsibly.WaitForCoroutineMethod(this.ThrowImmediately)) .ExpectWithinSeconds(1) .ToYieldInstruction(this.Executor, throwOnError: false); yield return(instruction); Assert.IsTrue(instruction.CompletedWithError); Assert.That( instruction.Error.Message, Does.Match(@"\[✓\] CompleteAfterOneFrame.*\n.*\[!\] ThrowImmediately")); }