Added ContentSize property and first unit test

This commit is contained in:
Tig
2024-03-19 17:52:44 -07:00
parent 6b1a429e56
commit 6f664c9c6a
3 changed files with 27 additions and 4 deletions

View File

@@ -24,16 +24,16 @@ public class ViewportTests (ITestOutputHelper output)
var view = new View ();
view.Frame = frame;
view.BeginInit();
view.EndInit();
view.BeginInit ();
view.EndInit ();
// Act
var bounds = view.Viewport;
// Assert
Assert.Equal(expectedW, bounds.Width);
Assert.Equal (expectedW, bounds.Width);
}
[Theory]
[InlineData (0, 0, 10)]
[InlineData (1, 0, 9)]
@@ -149,4 +149,15 @@ public class ViewportTests (ITestOutputHelper output)
// Assert
Assert.Equal (expectedW, bounds.Width);
}
[Fact]
public void ContentSize_Empty_ByDefault ()
{
View view = new ()
{
Width = 1,
Height = 1
};
Assert.Equal(Size.Empty, view.ContentSize);
}
}