Exemple #1
0
        public void ShouldReturnNullWhenNameIsNotFound()
        {
            var widthProperty = new AnimatableProperty <float>();
            var animatable    = new AnimatableObject("Object");

            animatable.Properties.Add("Width", widthProperty);

            Assert.IsNull(animatable.GetAnimatableProperty <float>("WrongName"));
        }
Exemple #2
0
        public void ShouldReturnNullWhenTypeDoesNotMatch()
        {
            var widthProperty = new AnimatableProperty <float>();
            var animatable    = new AnimatableObject("Object");

            animatable.Properties.Add("Width", widthProperty);

            Assert.IsNull(animatable.GetAnimatableProperty <string>("Width"));
        }
Exemple #3
0
        public void ShouldReturnAnimatableProperties()
        {
            var widthProperty  = new AnimatableProperty <float>();
            var heightProperty = new AnimatableProperty <float>();
            var textProperty   = new AnimatableProperty <string>();
            var animatable     = new AnimatableObject("Object");

            animatable.Properties.Add("Width", widthProperty);
            animatable.Properties.Add("Height", heightProperty);
            animatable.Properties.Add("Text", textProperty);

            Assert.That(animatable.Properties.Values, Has.Member(widthProperty));
            Assert.That(animatable.Properties.Values, Has.Member(heightProperty));
            Assert.That(animatable.Properties.Values, Has.Member(textProperty));

            Assert.AreEqual(widthProperty, animatable.GetAnimatableProperty <float>("Width"));
            Assert.AreEqual(heightProperty, animatable.GetAnimatableProperty <float>("Height"));
            Assert.AreEqual(textProperty, animatable.GetAnimatableProperty <string>("Text"));
        }