mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Fixing unit tests 4
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user