Dim.FillTests.cs 595 B

1234567891011121314151617181920212223
  1. using Xunit.Abstractions;
  2. namespace UnitTests.LayoutTests;
  3. public class DimFillTests (ITestOutputHelper output)
  4. {
  5. private readonly ITestOutputHelper _output = output;
  6. [Fact]
  7. public void DimFill_SizedCorrectly ()
  8. {
  9. var view = new View { Width = Dim.Fill (), Height = Dim.Fill (), BorderStyle = LineStyle.Single };
  10. var top = new Toplevel ();
  11. top.Add (view);
  12. top.Layout ();
  13. view.SetRelativeLayout (new (32, 5));
  14. Assert.Equal (32, view.Frame.Width);
  15. Assert.Equal (5, view.Frame.Height);
  16. top.Dispose ();
  17. }
  18. }