mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Added ContentSize property and first unit test
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user