Browse Source

Added another failing transitions test.

pull/5686/head
Steven Kirk 6 years ago
parent
commit
15a765490f
  1. 22
      tests/Avalonia.Animation.UnitTests/AnimatableTests.cs

22
tests/Avalonia.Animation.UnitTests/AnimatableTests.cs

@ -339,6 +339,28 @@ namespace Avalonia.Animation.UnitTests
control.Transitions = new Transitions { target.Object };
}
[Fact]
public void Transitions_Can_Re_Set_During_Batch_Update()
{
var target = CreateTarget();
var control = CreateControl(target.Object);
// Assigning and then clearing Transitions ensures we have a transition state
// collection created.
control.Transitions = null;
control.BeginBatchUpdate();
// Setting opacity then Transitions means that we receive the Transitions change
// after the Opacity change when EndBatchUpdate is called.
control.Opacity = 0.5;
control.Transitions = new Transitions { target.Object };
// Which means that the transition state hasn't been initialized with the new
// Transitions when the Opacity change notification gets raised here.
control.EndBatchUpdate();
}
private static Mock<ITransition> CreateTarget()
{
return CreateTransition(Visual.OpacityProperty);

Loading…
Cancel
Save