public void ForwardStartsAtZero() { var spy = new MorphSpy(); var smoothMorph = new SmoothMorpher(); smoothMorph.Forwards(spy).MoveNext(); Assert.AreEqual(0, spy.Time); }
public IEnumerator MorphWithAShortDuration() { var duration = 0.5f; var morpher = new SmoothMorpher(duration); var timeStarted = Time.time; yield return(morpher.Forwards(new MorphSpy())); Assert.AreEqual(duration, Time.time - timeStarted, 0.1); }
public IEnumerator ChainsTwoCoroutinesTogether() { var spy = new MorphSpy(); var morpher = new SmoothMorpher(0.05f); var chainedRoutine = morpher.Forwards(spy).Then(morpher.Backwards(spy)); yield return(chainedRoutine); Assert.AreEqual(0, spy.Time); }
public void ForwardEndsAtOne() { var spy = new MorphSpy(); var smoothMorph = new SmoothMorpher(); var enumerator = smoothMorph.Forwards(spy); while (enumerator.MoveNext()) { ; } Assert.AreEqual(1f, spy.Time); }