Exemple #1
0
        public void AnimateTo()
        {
            var animation = new Vector3FromToByAnimation();

            animation.From = null;
            animation.To   = new Vector3(2.0f, 20.0f, 200.0f);
            animation.By   = null;
            Assert.AreEqual(new Vector3(0.0f, 0.0f, 0.0f), animation.GetValue(TimeSpan.FromSeconds(0.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(1.0f, 10.0f, 100.0f), animation.GetValue(TimeSpan.FromSeconds(0.5), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(2.0f, 20.0f, 200.0f), animation.GetValue(TimeSpan.FromSeconds(1.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
        }
Exemple #2
0
        public void ShouldIgnoreByIfToIsSet()
        {
            var animation = new Vector3FromToByAnimation();

            animation.From = null;
            animation.To   = new Vector3(4.0f, 40.0f, 400.0f);
            animation.By   = new Vector3(10.0f, 100.0f, 1000.0f);
            Assert.AreEqual(new Vector3(0.0f, 0.0f, 0.0f), animation.GetValue(TimeSpan.FromSeconds(0.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(2.0f, 20.0f, 200.0f), animation.GetValue(TimeSpan.FromSeconds(0.5), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3(4.0f, 40.0f, 400.0f), animation.GetValue(TimeSpan.FromSeconds(1.0), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(10.0f, 100.0f, 1000.0f)));
        }
Exemple #3
0
        public void CheckDefaultValues()
        {
            var animation = new Vector3FromToByAnimation();

            Assert.AreEqual(TimeSpan.FromSeconds(1.0), animation.Duration);
            Assert.AreEqual(FillBehavior.Hold, animation.FillBehavior);
            Assert.IsNull(animation.TargetProperty);
            Assert.IsFalse(animation.From.HasValue);
            Assert.IsFalse(animation.To.HasValue);
            Assert.IsFalse(animation.By.HasValue);
            Assert.IsFalse(animation.IsAdditive);
            Assert.IsNull(animation.EasingFunction);
        }