Пример #1
0
        public void ForwardStartsAtZero()
        {
            var spy            = new MorphSpy();
            var staggeredMorph = new StaggeredMorpher(0);

            staggeredMorph.Forwards(spy).MoveNext();

            Assert.AreEqual(0, spy.Time);
        }
Пример #2
0
        public void RunTwoMorphsAtTheSameTime()
        {
            var firstSpy  = new MorphSpy();
            var secondSpy = new MorphSpy();

            firstSpy.And(secondSpy).Frame(1);

            Assert.AreEqual(true, firstSpy.WasCalled && secondSpy.WasCalled);
        }
Пример #3
0
        public void BackwardsStartsAtOne()
        {
            var spy = new MorphSpy();
            var staggeredMorpher = new StaggeredMorpher(0);

            staggeredMorpher.Backwards(spy).MoveNext();

            Assert.AreEqual(1, spy.Time);
        }
Пример #4
0
        public void BackwardsStartsAtOne()
        {
            var spy         = new MorphSpy();
            var smoothMorph = new SmoothMorpher();

            smoothMorph.Backwards(spy).MoveNext();

            Assert.AreEqual(1, spy.Time);
        }
Пример #5
0
        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);
        }
Пример #6
0
        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);
        }
Пример #7
0
        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);
        }
Пример #8
0
        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);
        }
Пример #9
0
        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);
        }
Пример #10
0
        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);
        }
Пример #11
0
        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);
        }
Пример #12
0
        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);
        }
Пример #13
0
        public void BackwardsEndsAtZero()
        {
            var spy         = new MorphSpy();
            var smoothMorph = new SmoothMorpher();

            var enumerator = smoothMorph.Backwards(spy);

            while (enumerator.MoveNext())
            {
                ;
            }

            Assert.AreEqual(0, spy.Time);
        }
Пример #14
0
 public void InitSpy()
 {
     _spy = new MorphSpy();
 }