Dim.FillTests.cs 759 B

12345678910111213141516171819202122232425262728
  1. using UnitTests;
  2. using Xunit.Abstractions;
  3. namespace Terminal.Gui.LayoutTests;
  4. public class DimFillTests (ITestOutputHelper output)
  5. {
  6. private readonly ITestOutputHelper _output = output;
  7. [Fact]
  8. [AutoInitShutdown]
  9. public void DimFill_SizedCorrectly ()
  10. {
  11. var view = new View { Width = Dim.Fill (), Height = Dim.Fill (), BorderStyle = LineStyle.Single };
  12. var top = new Toplevel ();
  13. top.Add (view);
  14. RunState rs = Application.Begin (top);
  15. ((FakeDriver)Application.Driver!).SetBufferSize (32, 5);
  16. top.Layout ();
  17. //view.SetRelativeLayout (new (0, 0, 32, 5));
  18. Assert.Equal (32, view.Frame.Width);
  19. Assert.Equal (5, view.Frame.Height);
  20. top.Dispose ();
  21. }
  22. }