Files
OpenNest/OpenNest.Desktop.Tests/LargeDialogBoundsTests.cs
T
ajandClaude Opus 5.5 a7302d3224 refactor(desktop): share the large browse dialogs' sizing
LargeDialogBounds computes the bounds the large browse dialogs open at:
nine tenths of the owner screen's working area, centered, never below the
dialog's minimum size. WinForms' DialogBounds now calls it with the
screen's working area, with unchanged behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 21:13:53 -05:00

29 lines
813 B
C#

namespace OpenNest.Desktop.Tests;
public class LargeDialogBoundsTests
{
[Fact]
public void Centered_NineTenthsOfTheWorkingArea()
{
var bounds = LargeDialogBounds.Centered(new PixelRect(0, 0, 1920, 1040), 800, 600);
Assert.Equal(new PixelRect(96, 52, 1728, 936), bounds);
}
[Fact]
public void Centered_OnASecondaryScreen()
{
var bounds = LargeDialogBounds.Centered(new PixelRect(1920, -200, 2560, 1400), 800, 600);
Assert.Equal(new PixelRect(1920 + 128, -200 + 70, 2304, 1260), bounds);
}
[Fact]
public void Centered_NeverBelowTheMinimumOrBeforeTheWorkingArea()
{
var bounds = LargeDialogBounds.Centered(new PixelRect(100, 50, 1000, 700), 1200, 900);
Assert.Equal(new PixelRect(100, 50, 1200, 900), bounds);
}
}