Fixing unit tests 4

This commit is contained in:
Tig
2024-10-18 17:06:51 -06:00
parent 172409f17a
commit 5dc832b6e3
35 changed files with 866 additions and 485 deletions

View File

@@ -67,6 +67,7 @@ public class RulerTests
);
// Postive offset
top.SetNeedsDisplay ();
Application.Refresh ();
r.Draw (new (1, 1));
@@ -81,6 +82,7 @@ public class RulerTests
);
// Negative offset
top.SetNeedsDisplay ();
Application.Refresh ();
r.Draw (new (-1, 1));
@@ -95,6 +97,7 @@ public class RulerTests
);
// Clip
top.SetNeedsDisplay ();
Application.Refresh ();
r.Draw (new (10, 1));
@@ -140,7 +143,7 @@ public class RulerTests
_output
);
Application.Refresh ();
Application.Refresh (true);
r.Length = len;
r.Draw (new (1, 0), 1);
@@ -202,7 +205,7 @@ public class RulerTests
);
// Postive offset
Application.Refresh ();
Application.Refresh (true);
r.Draw (new (1, 1));
TestHelpers.AssertDriverContentsWithFrameAre (
@@ -231,7 +234,7 @@ public class RulerTests
);
// Negative offset
Application.Refresh ();
Application.Refresh (true);
r.Draw (new (1, -1));
TestHelpers.AssertDriverContentsWithFrameAre (
@@ -260,7 +263,7 @@ public class RulerTests
);
// Clip
Application.Refresh ();
Application.Refresh (true);
r.Draw (new (1, 10));
TestHelpers.AssertDriverContentsWithFrameAre (
@@ -335,7 +338,7 @@ public class RulerTests
_output
);
Application.Refresh ();
Application.Refresh (true);
r.Length = len;
r.Draw (new (0, 1), 1);

View File

@@ -172,12 +172,13 @@ public class ThicknessTests (ITestOutputHelper output)
var top = new Toplevel ();
top.Add (f);
Application.Begin (top);
RunState rs = Application.Begin (top);
((FakeDriver)Application.Driver!).SetBufferSize (45, 20);
var t = new Thickness (0, 0, 0, 0);
var r = new Rectangle (2, 2, 40, 15);
Application.Refresh ();
Application.RunIteration (ref rs);
View.Diagnostics |= ViewDiagnosticFlags.Ruler;
t.Draw (r, "Test");
View.Diagnostics = ViewDiagnosticFlags.Off;
@@ -209,7 +210,8 @@ public class ThicknessTests (ITestOutputHelper output)
t = new Thickness (1, 1, 1, 1);
r = new Rectangle (1, 1, 40, 15);
Application.Refresh ();
top.SetNeedsDisplay ();
Application.RunIteration (ref rs);
View.Diagnostics |= ViewDiagnosticFlags.Ruler;
t.Draw (r, "Test");
View.Diagnostics = ViewDiagnosticFlags.Off;
@@ -241,7 +243,8 @@ public class ThicknessTests (ITestOutputHelper output)
t = new Thickness (1, 2, 3, 4);
r = new Rectangle (2, 2, 40, 15);
Application.Refresh ();
top.SetNeedsDisplay ();
Application.RunIteration (ref rs);
View.Diagnostics |= ViewDiagnosticFlags.Ruler;
t.Draw (r, "Test");
View.Diagnostics = ViewDiagnosticFlags.Off;
@@ -273,7 +276,8 @@ public class ThicknessTests (ITestOutputHelper output)
t = new Thickness (-1, 1, 1, 1);
r = new Rectangle (5, 5, 40, 15);
Application.Refresh ();
top.SetNeedsDisplay ();
Application.RunIteration (ref rs);
View.Diagnostics |= ViewDiagnosticFlags.Ruler;
t.Draw (r, "Test");
View.Diagnostics = ViewDiagnosticFlags.Off;