public void IsFinished_SetTimeBeyondDuration_True()
        {
            const float duration  = 1.0f;
            var         animation = new FakeAnimation(duration);
            var         player    = new AnimationPlayer(animation);

            player.SetTime(float.MaxValue);
            Assert.That(player.IsFinished, Is.True);
        }
        public void SetTime_LargeValue_ProgressIsOne()
        {
            const float duration  = 1.0f;
            var         animation = new FakeAnimation(duration);
            var         player    = new AnimationPlayer(animation);

            player.SetTime(float.MaxValue);
            Assert.That(animation.Progress, Is.EqualTo(1.0f));
        }
        public void SetTime_NegativeValue_ProgressIsZero()
        {
            const float duration  = 1.0f;
            var         animation = new FakeAnimation(duration);
            var         player    = new AnimationPlayer(animation);

            player.SetTime(-1f);
            Assert.That(animation.Progress, Is.EqualTo(0.0f));
        }
        public void SetTime_CanSet()
        {
            const float duration  = 1.0f;
            var         animation = new FakeAnimation(duration);
            var         player    = new AnimationPlayer(animation);

            player.SetTime(0.3f);
            Assert.That(animation.Progress, Is.EqualTo(0.3f));
        }
        public void NotPlay_NotProgressing()
        {
            const float duration  = 1.0f;
            var         animation = new FakeAnimation(duration);
            var         player    = new AnimationPlayer(animation);

            Assert.That(animation.Progress, Is.EqualTo(0.0f));
            player.Update(0.1f);
            Assert.That(animation.Progress, Is.EqualTo(0.0f));
        }
        public void Reset_CanReset()
        {
            const float duration  = 1.0f;
            var         animation = new FakeAnimation(duration);
            var         player    = new AnimationPlayer(animation);

            player.Play();
            Assert.That(animation.Progress, Is.EqualTo(0.0f));
            player.Update(0.1f);
            Assert.That(animation.Progress, Is.EqualTo(0.1f / 1.0f));
            player.Reset();
            Assert.That(animation.Progress, Is.EqualTo(0.0f));
        }