示例#1
0
        public void GenerateEasing()
        {
            Assert.AreEqual(Easing.None, ValueGenerator.GenerateEasing(EasingMethod.None, true, true));
            Assert.AreEqual(Easing.EaseInOut, ValueGenerator.GenerateEasing(EasingMethod.Ease, true, true));
            Assert.AreEqual(Easing.EaseIn, ValueGenerator.GenerateEasing(EasingMethod.Ease, true, false));
            Assert.AreEqual(Easing.EaseOut, ValueGenerator.GenerateEasing(EasingMethod.Ease, false, true));
            Assert.AreEqual(Easing.ElasticInOut, ValueGenerator.GenerateEasing(EasingMethod.Elastic, true, true));
            Assert.AreEqual(Easing.ElasticIn, ValueGenerator.GenerateEasing(EasingMethod.Elastic, true, false));
            Assert.AreEqual(Easing.ElasticOut, ValueGenerator.GenerateEasing(EasingMethod.Elastic, false, true));
            Assert.AreEqual(Easing.BounceInOut, ValueGenerator.GenerateEasing(EasingMethod.Bounce, true, true));
            Assert.AreEqual(Easing.BounceIn, ValueGenerator.GenerateEasing(EasingMethod.Bounce, true, false));
            Assert.AreEqual(Easing.BounceOut, ValueGenerator.GenerateEasing(EasingMethod.Bounce, false, true));
            Assert.AreEqual(Easing.ExponentialInOut, ValueGenerator.GenerateEasing(EasingMethod.Exponential, true, true));
            Assert.AreEqual(Easing.ExponentialIn, ValueGenerator.GenerateEasing(EasingMethod.Exponential, true, false));
            Assert.AreEqual(Easing.ExponentialOut, ValueGenerator.GenerateEasing(EasingMethod.Exponential, false, true));
            Assert.AreEqual(Easing.SineInOut, ValueGenerator.GenerateEasing(EasingMethod.Sine, true, true));
            Assert.AreEqual(Easing.SineIn, ValueGenerator.GenerateEasing(EasingMethod.Sine, true, false));
            Assert.AreEqual(Easing.SineOut, ValueGenerator.GenerateEasing(EasingMethod.Sine, false, true));
            Assert.AreEqual(Easing.BackInOut, ValueGenerator.GenerateEasing(EasingMethod.Back, true, true));
            Assert.AreEqual(Easing.BackIn, ValueGenerator.GenerateEasing(EasingMethod.Back, true, false));
            Assert.AreEqual(Easing.BackOut, ValueGenerator.GenerateEasing(EasingMethod.Back, false, true));

            Assert.Catch(() => ValueGenerator.GenerateEasing(EasingMethod.Ease, false, false));
        }