Made unit tests more resiliant to config changes

This commit is contained in:
Tig
2024-08-04 15:08:18 -06:00
parent 271a73cba1
commit f5b1984db7
2 changed files with 15 additions and 0 deletions

View File

@@ -622,6 +622,11 @@ public class FileDialogTests (ITestOutputHelper output)
private FileDialog GetWindowsDialog ()
{
// Override CM
Window.DefaultBorderStyle = LineStyle.Single;
Dialog.DefaultButtonAlignment = Alignment.Center;
Dialog.DefaultBorderStyle = LineStyle.Single;
// Arrange
var fileSystem = new MockFileSystem (new Dictionary<string, MockFileData> (), @"c:\");
fileSystem.MockTime (() => new (2010, 01, 01, 11, 12, 43));

View File

@@ -362,6 +362,11 @@ public class MenuBarTests (ITestOutputHelper output)
[AutoInitShutdown]
public void Draw_A_Menu_Over_A_Dialog ()
{
// Override CM
Window.DefaultBorderStyle = LineStyle.Single;
Dialog.DefaultButtonAlignment = Alignment.Center;
Dialog.DefaultBorderStyle = LineStyle.Single;
Toplevel top = new ();
var win = new Window ();
top.Add (win);
@@ -590,6 +595,11 @@ public class MenuBarTests (ITestOutputHelper output)
[AutoInitShutdown]
public void Draw_A_Menu_Over_A_Top_Dialog ()
{
// Override CM
Window.DefaultBorderStyle = LineStyle.Single;
Dialog.DefaultButtonAlignment = Alignment.Center;
Dialog.DefaultBorderStyle = LineStyle.Single;
((FakeDriver)Application.Driver).SetBufferSize (40, 15);
Assert.Equal (new (0, 0, 40, 15), Application.Driver.Clip);