Jumar Macato
6 years ago
No known key found for this signature in database
GPG Key ID: B19884DAC3A5BF3F
1 changed files with
49 additions and
0 deletions
-
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() |
|
|
|
{ |
|
|
|
|