@ -297,12 +297,12 @@ namespace Avalonia.Controls.UnitTests
{
var parentWindowImpl = MockWindowingPlatform . CreateWindowMock ( ) ;
parentWindowImpl . Setup ( x = > x . ClientSize ) . Returns ( new Size ( 8 0 0 , 4 8 0 ) ) ;
parentWindowImpl . Setup ( x = > x . MaxClientSize ) . Returns ( new Size ( 1 9 2 0 , 1 0 8 0 ) ) ;
parentWindowImpl . Setup ( x = > x . MaxAutoSizeHint ) . Returns ( new Size ( 1 9 2 0 , 1 0 8 0 ) ) ;
parentWindowImpl . Setup ( x = > x . Scaling ) . Returns ( 1 ) ;
var windowImpl = MockWindowingPlatform . CreateWindowMock ( ) ;
windowImpl . Setup ( x = > x . ClientSize ) . Returns ( new Size ( 3 2 0 , 2 0 0 ) ) ;
windowImpl . Setup ( x = > x . MaxClientSize ) . Returns ( new Size ( 1 9 2 0 , 1 0 8 0 ) ) ;
windowImpl . Setup ( x = > x . MaxAutoSizeHint ) . Returns ( new Size ( 1 9 2 0 , 1 0 8 0 ) ) ;
windowImpl . Setup ( x = > x . Scaling ) . Returns ( 1 ) ;
var parentWindowServices = TestServices . StyledWindow . With (
@ -380,12 +380,15 @@ namespace Avalonia.Controls.UnitTests
}
[Fact]
public void Child_Should_Be_Measured_With_Infinity _If_SizeToContent_Is_WidthAndHeight ( )
public void Child_Should_Be_Measured_With_MaxAutoSizeHint _If_SizeToContent_Is_WidthAndHeight ( )
{
using ( UnitTestApplication . Start ( TestServices . StyledWindow ) )
{
var windowImpl = MockWindowingPlatform . CreateWindowMock ( ) ;
windowImpl . Setup ( x = > x . MaxAutoSizeHint ) . Returns ( new Size ( 1 2 0 0 , 1 0 0 0 ) ) ;
var child = new ChildControl ( ) ;
var target = new Window
var target = new Window ( windowImpl . Object )
{
Width = 1 0 0 ,
Height = 5 0 ,
@ -396,7 +399,7 @@ namespace Avalonia.Controls.UnitTests
target . Show ( ) ;
Assert . Equal ( 1 , child . MeasureSizes . Count ) ;
Assert . Equal ( Size . Infinity , child . MeasureSizes [ 0 ] ) ;
Assert . Equal ( new Size ( 1 2 0 0 , 1 0 0 0 ) , child . MeasureSizes [ 0 ] ) ;
}
}