public void ShouldReturnNullWhenNameIsNotFound() { var widthProperty = new AnimatableProperty <float>(); var animatable = new AnimatableObject("Object"); animatable.Properties.Add("Width", widthProperty); Assert.IsNull(animatable.GetAnimatableProperty <float>("WrongName")); }
public void ShouldReturnNullWhenTypeDoesNotMatch() { var widthProperty = new AnimatableProperty <float>(); var animatable = new AnimatableObject("Object"); animatable.Properties.Add("Width", widthProperty); Assert.IsNull(animatable.GetAnimatableProperty <string>("Width")); }
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")); }