Browse Source

Added failing test for #1297

pull/1298/head
Steven Kirk 9 years ago
parent
commit
26b2771864
  1. 26
      tests/Avalonia.Controls.UnitTests/Primitives/TrackTests.cs

26
tests/Avalonia.Controls.UnitTests/Primitives/TrackTests.cs

@ -140,5 +140,31 @@ namespace Avalonia.Controls.UnitTests.Primitives
Assert.Same(thumb.Parent, target);
Assert.Equal(new[] { thumb }, ((ILogical)target).LogicalChildren);
}
[Fact]
public void Should_Not_Pass_Invalid_Arrange_Rect()
{
var thumb = new Thumb { Width = 100.873106060606 };
var increaseButton = new Button { Width = 10 };
var decreaseButton = new Button { Width = 10 };
var target = new Track
{
Height = 12,
Thumb = thumb,
IncreaseButton = increaseButton,
DecreaseButton = decreaseButton,
Orientation = Orientation.Horizontal,
Minimum = 0,
Maximum = 287,
Value = 287,
ViewportSize = 241,
};
target.Measure(Size.Infinity);
// #1297 was occuring here.
target.Arrange(new Rect(0, 0, 221, 12));
}
}
}

Loading…
Cancel
Save