Browse Source

Add failing test for #3653

pull/3836/head
Jumar Macato 6 years ago
parent
commit
8f7f4b7267
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 49
      tests/Avalonia.Animation.UnitTests/AnimationIterationTests.cs

49
tests/Avalonia.Animation.UnitTests/AnimationIterationTests.cs

@ -14,6 +14,55 @@ namespace Avalonia.Animation.UnitTests
{
public class AnimationIterationTests
{
[Fact]
public void Check_KeyTime_Correctly_Converted_To_Cue()
{
var keyframe1 = new KeyFrame()
{
Setters =
{
new Setter(Border.WidthProperty, 100d),
},
KeyTime = TimeSpan.FromSeconds(0.5)
};
var keyframe2 = new KeyFrame()
{
Setters =
{
new Setter(Border.WidthProperty, 0d),
},
KeyTime = TimeSpan.FromSeconds(0)
};
var animation = new Animation()
{
Duration = TimeSpan.FromSeconds(1),
Children =
{
keyframe2,
keyframe1
}
};
var border = new Border()
{
Height = 100d,
Width = 100d
};
var clock = new TestClock();
var animationRun = animation.RunAsync(border, clock);
clock.Step(TimeSpan.Zero);
Assert.Equal(border.Width, 0d);
clock.Step(TimeSpan.FromSeconds(1));
Assert.Equal(border.Width, 100d);
}
[Fact]
public void Check_Initial_Inter_and_Trailing_Delay_Values()
{

Loading…
Cancel
Save