public void ForwardStartsAtZero() { var spy = new MorphSpy(); var staggeredMorph = new StaggeredMorpher(0); staggeredMorph.Forwards(spy).MoveNext(); Assert.AreEqual(0, spy.Time); }
public void RunTwoMorphsAtTheSameTime() { var firstSpy = new MorphSpy(); var secondSpy = new MorphSpy(); firstSpy.And(secondSpy).Frame(1); Assert.AreEqual(true, firstSpy.WasCalled && secondSpy.WasCalled); }
public void BackwardsStartsAtOne() { var spy = new MorphSpy(); var staggeredMorpher = new StaggeredMorpher(0); staggeredMorpher.Backwards(spy).MoveNext(); Assert.AreEqual(1, spy.Time); }
public void BackwardsStartsAtOne() { var spy = new MorphSpy(); var smoothMorph = new SmoothMorpher(); smoothMorph.Backwards(spy).MoveNext(); Assert.AreEqual(1, spy.Time); }
public void ChainMultipleAnds() { var firstSpy = new MorphSpy(); var secondSpy = new MorphSpy(); var thirdSpy = new MorphSpy(); firstSpy.And(secondSpy).And(thirdSpy).Frame(1); Assert.AreEqual(true, firstSpy.WasCalled && secondSpy.WasCalled && thirdSpy.WasCalled); }
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 FirstIntermediateFrameIsHalfWithOneIntermediateFrame() { var spy = new MorphSpy(); var staggeredMorpher = new StaggeredMorpher(1); var enumerator = staggeredMorpher.Backwards(spy); enumerator.MoveNext(); enumerator.MoveNext(); Assert.AreEqual(0.5f, spy.Time); }
public void FirstIntermediateFrameIsAThirdWithTwoIntermediateFrames() { var spy = new MorphSpy(); var staggeredMorpher = new StaggeredMorpher(2); var enumerator = staggeredMorpher.Forwards(spy); enumerator.MoveNext(); enumerator.MoveNext(); Assert.AreEqual(0.333f, spy.Time, 0.01); }
public void FramesFourTimesWithTwoIntermediateSteps() { var spy = new MorphSpy(); var staggeredMorpher = new StaggeredMorpher(2); var enumerator = staggeredMorpher.Forwards(spy); while (enumerator.MoveNext()) { ; } Assert.AreEqual(4, spy.FrameCount); }
public void FramesThreeTimesWithOneIntermediateStep() { var spy = new MorphSpy(); var staggeredMorpher = new StaggeredMorpher(1); var enumerator = staggeredMorpher.Forwards(spy); while (enumerator.MoveNext()) { ; } Assert.AreEqual(3, spy.FrameCount); }
public void BackwardsEndsAtZero() { var spy = new MorphSpy(); var staggeredMorpher = new StaggeredMorpher(0); var enumerator = staggeredMorpher.Backwards(spy); while (enumerator.MoveNext()) { ; } Assert.AreEqual(0, spy.Time); }
public void ForwardEndsAtOne() { var spy = new MorphSpy(); var staggeredMorph = new StaggeredMorpher(0); var enumerator = staggeredMorph.Forwards(spy); while (enumerator.MoveNext()) { ; } Assert.AreEqual(1f, spy.Time); }
public void BackwardsEndsAtZero() { var spy = new MorphSpy(); var smoothMorph = new SmoothMorpher(); var enumerator = smoothMorph.Backwards(spy); while (enumerator.MoveNext()) { ; } Assert.AreEqual(0, spy.Time); }
public void InitSpy() { _spy = new MorphSpy(); }