diff --git a/src/WinUIEx.Tests/WindowManagerTests.cs b/src/WinUIEx.Tests/WindowManagerTests.cs index e89e752..2e8b75f 100644 --- a/src/WinUIEx.Tests/WindowManagerTests.cs +++ b/src/WinUIEx.Tests/WindowManagerTests.cs @@ -85,8 +85,7 @@ await UITestHelper.RunWindowTest(async (window) => } [TestMethod] - public async Task SetMaxWidth() - { + public async Task SetMaxWidth() => await UITestHelper.RunWindowTest(async (window) => { window.Content = new Grid(); @@ -96,7 +95,21 @@ await UITestHelper.RunWindowTest(async (window) => await window.Content.LoadAsync(); Assert.AreEqual(500, window.AppWindow.Size.Width / window.Content.XamlRoot.RasterizationScale); }); - } + + [TestMethod] + public async Task ResetMaxWidth() => + await UITestHelper.RunWindowTest(async (window) => + { + window.Content = new Grid(); + var manager = WindowManager.Get(window); + manager.Width = 600; + manager.MaxWidth = 500; + await window.Content.LoadAsync(); + Assert.AreEqual(500, window.AppWindow.Size.Width / window.Content.XamlRoot.RasterizationScale); + manager.MaxWidth = 0; + manager.Width = 600; + Assert.AreEqual(600, window.AppWindow.Size.Width / window.Content.XamlRoot.RasterizationScale); + }); [TestMethod] public async Task SetMaxHeight() => await UITestHelper.RunWindowTest(async (window) => @@ -109,6 +122,22 @@ public async Task SetMaxHeight() => await UITestHelper.RunWindowTest(async (wind Assert.AreEqual(500, window.AppWindow.Size.Height / window.Content.XamlRoot.RasterizationScale); }); + + [TestMethod] + public async Task ResetMaxHeight() => + await UITestHelper.RunWindowTest(async (window) => + { + window.Content = new Grid(); + var manager = WindowManager.Get(window); + manager.Height = 600; + manager.MaxHeight = 500; + await window.Content.LoadAsync(); + Assert.AreEqual(500, window.AppWindow.Size.Height / window.Content.XamlRoot.RasterizationScale); + manager.MaxHeight = 0; + manager.Height = 600; + Assert.AreEqual(600, window.AppWindow.Size.Height / window.Content.XamlRoot.RasterizationScale); + }); + [TestMethod] [Timeout(5000)] public async Task GetWindowState() => await UITestHelper.RunWindowTest(async (window) =>