コード例 #1
0
        public IEnumerator StartAsyncCoroutine_Successfully()
        {
            const int testValue1    = 5;
            const int testValue2    = 10;
            int       testCompleted = 0;

            IAsyncCoroutine asyncCoroutine = _coroutineService.StartAsyncCoroutine(TestCoroutine(testValue1));

            asyncCoroutine.OnComplete(() => testCompleted = testValue2);

            yield return(asyncCoroutine.Coroutine);

            Assert.IsTrue(asyncCoroutine.IsCompleted);
            Assert.AreEqual(testValue1, _testValue);
            Assert.AreEqual(testValue2, testCompleted);
        }