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

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

            animation.From = null;
            animation.To   = new Vector3F(2.0f, 20.0f, 200.0f);
            animation.By   = null;
            Assert.AreEqual(new Vector3F(0.0f, 0.0f, 0.0f), animation.GetValue(TimeSpan.FromSeconds(0.0), new Vector3F(0.0f, 0.0f, 0.0f), new Vector3F(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3F(1.0f, 10.0f, 100.0f), animation.GetValue(TimeSpan.FromSeconds(0.5), new Vector3F(0.0f, 0.0f, 0.0f), new Vector3F(10.0f, 100.0f, 1000.0f)));
            Assert.AreEqual(new Vector3F(2.0f, 20.0f, 200.0f), animation.GetValue(TimeSpan.FromSeconds(1.0), new Vector3F(0.0f, 0.0f, 0.0f), new Vector3F(10.0f, 100.0f, 1000.0f)));
        }
Example #4
0
        public void CheckDefaultValues()
        {
            var animation = new Vector3FFromToByAnimation();

            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);
        }
Example #5
0
 public void ShouldIgnoreByIfToIsSet()
 {
     var animation = new Vector3FFromToByAnimation();
       animation.From = null;
       animation.To = new Vector3F(4.0f, 40.0f, 400.0f);
       animation.By = new Vector3F(10.0f, 100.0f, 1000.0f);
       Assert.AreEqual(new Vector3F(0.0f, 0.0f, 0.0f), animation.GetValue(TimeSpan.FromSeconds(0.0), new Vector3F(0.0f, 0.0f, 0.0f), new Vector3F(10.0f, 100.0f, 1000.0f)));
       Assert.AreEqual(new Vector3F(2.0f, 20.0f, 200.0f), animation.GetValue(TimeSpan.FromSeconds(0.5), new Vector3F(0.0f, 0.0f, 0.0f), new Vector3F(10.0f, 100.0f, 1000.0f)));
       Assert.AreEqual(new Vector3F(4.0f, 40.0f, 400.0f), animation.GetValue(TimeSpan.FromSeconds(1.0), new Vector3F(0.0f, 0.0f, 0.0f), new Vector3F(10.0f, 100.0f, 1000.0f)));
 }
Example #6
0
 public void CheckDefaultValues()
 {
     var animation = new Vector3FFromToByAnimation();
       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);
 }