public IEnumerator Start() { var executer = new CoroutineExecuterGameObject(); var coroutine = new TestCoroutine(); executer.Initialize(); Assert.False(coroutine.IsCompleted); Assert.False(coroutine.IsStarted); Assert.False(coroutine.IsEnded); executer.Start(coroutine); Assert.False(coroutine.IsCompleted); Assert.True(coroutine.IsStarted); Assert.False(coroutine.IsEnded); yield return(coroutine); Assert.True(coroutine.IsCompleted); Assert.True(coroutine.IsStarted); Assert.True(coroutine.IsEnded); executer.Uninitialize(); }
public IEnumerator IsCompleted() { var coroutine = new TestCoroutine(); Assert.False(coroutine.IsCompleted); yield return(coroutine); Assert.True(coroutine.IsCompleted); }
public IEnumerator HasResult() { var coroutine = new TestCoroutine(); Assert.False(coroutine.HasResult); yield return(coroutine); Assert.True(coroutine.HasResult); }
public IEnumerator Routine() { var coroutine = new TestCoroutine(); Assert.False(coroutine.IsStarted); Assert.False(coroutine.IsEnded); yield return(coroutine); Assert.True(coroutine.IsStarted); Assert.True(coroutine.IsEnded); }
public IEnumerator CompletedWithResult() { bool completed = false; var coroutine = new TestCoroutine(); coroutine.Completed += coroutine1 => completed = true; Assert.False(completed); yield return(coroutine); Assert.True(completed); }
public IEnumerator Result() { var coroutine = new TestCoroutine(); Assert.Throws <InvalidOperationException>(() => { // ReSharper disable once UnusedVariable Target result = coroutine.Result; }); yield return(coroutine); Assert.DoesNotThrow(() => { // ReSharper disable once UnusedVariable Target result = coroutine.Result; }); }
public IEnumerator Started() { var executer = new GameObject().AddComponent <CoroutineExecuter>(); var coroutine = new TestCoroutine(); Assert.False(coroutine.IsCompleted); Assert.False(coroutine.IsStarted); Assert.False(coroutine.IsEnded); executer.StartCoroutine(coroutine); Assert.False(coroutine.IsCompleted); Assert.True(coroutine.IsStarted); Assert.False(coroutine.IsEnded); yield return(coroutine); Assert.True(coroutine.IsCompleted); Assert.True(coroutine.IsStarted); Assert.True(coroutine.IsEnded); }