mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Fix IFakeConsoleDriver casting issues and update FakeDriverRenderingTests
- Replace IFakeConsoleDriver casts with FakeDriver in all test files - Add DriverAssert to UnitTestsParallelizable project - Update FakeDriverRenderingTests to use direct driver operations instead of View rendering - All tests now pass (21 UnitTests + 16 UnitTestsParallelizable FakeDriver tests) Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -3828,7 +3828,7 @@ ssb
|
||||
[SetupFakeDriver]
|
||||
public void FillRemaining_True_False ()
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (22, 5);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (22, 5);
|
||||
|
||||
Attribute [] attrs =
|
||||
{
|
||||
@@ -4050,7 +4050,7 @@ Nice Work")]
|
||||
Size tfSize = tf.FormatAndGetSize ();
|
||||
Assert.Equal (new (59, 13), tfSize);
|
||||
|
||||
((IFakeConsoleDriver)Application.Driver).SetBufferSize (tfSize.Width, tfSize.Height);
|
||||
((FakeDriver)Application.Driver).SetBufferSize (tfSize.Width, tfSize.Height);
|
||||
|
||||
Application.Driver.FillRect (Application.Screen, (Rune)'*');
|
||||
tf.Draw (Application.Screen, Attribute.Default, Attribute.Default);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class ShadowStyleTests (ITestOutputHelper output)
|
||||
[SetupFakeDriver]
|
||||
public void ShadowView_Colors (ShadowStyle style, string expectedAttrs)
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (5, 5);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (5, 5);
|
||||
Color fg = Color.Red;
|
||||
Color bg = Color.Green;
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ShadowStyleTests (ITestOutputHelper output)
|
||||
[SetupFakeDriver]
|
||||
public void Visual_Test (ShadowStyle style, string expected)
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (5, 5);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (5, 5);
|
||||
|
||||
var superView = new Toplevel
|
||||
{
|
||||
|
||||
@@ -998,7 +998,7 @@ w ";
|
||||
[SetupFakeDriver]
|
||||
public void Narrow_Wide_Runes ()
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (32, 32);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (32, 32);
|
||||
var top = new View { Width = 32, Height = 32 };
|
||||
|
||||
var text = $"First line{Environment.NewLine}Second line";
|
||||
|
||||
@@ -892,7 +892,7 @@ e
|
||||
[SetupFakeDriver]
|
||||
public void Label_Height_Zero_Stays_Zero ()
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (10, 4);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (10, 4);
|
||||
var text = "Label";
|
||||
|
||||
var label = new Label
|
||||
|
||||
@@ -2206,7 +2206,7 @@ public class TableViewTests (ITestOutputHelper output)
|
||||
[SetupFakeDriver]
|
||||
public void TestEnumerableDataSource_BasicTypes ()
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (100, 100);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (100, 100);
|
||||
var tv = new TableView ();
|
||||
tv.SchemeName = "TopLevel";
|
||||
tv.Viewport = new (0, 0, 50, 6);
|
||||
|
||||
@@ -507,10 +507,10 @@ public class ToplevelTests
|
||||
top.BeginInit ();
|
||||
top.EndInit ();
|
||||
|
||||
Exception exception = Record.Exception (() => ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (0, 10));
|
||||
Exception exception = Record.Exception (() => ((FakeDriver)Application.Driver!).SetBufferSize (0, 10));
|
||||
Assert.Null (exception);
|
||||
|
||||
exception = Record.Exception (() => ((IFakeConsoleDriver)Application.Driver!).SetBufferSize (10, 0));
|
||||
exception = Record.Exception (() => ((FakeDriver)Application.Driver!).SetBufferSize (10, 0));
|
||||
Assert.Null (exception);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ public class TreeTableSourceTests : IDisposable
|
||||
[SetupFakeDriver]
|
||||
public void TestTreeTableSource_BasicExpanding_WithKeyboard ()
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (100, 100);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (100, 100);
|
||||
TableView tv = GetTreeTable (out _);
|
||||
|
||||
tv.Style.GetOrCreateColumnStyle (1).MinAcceptableWidth = 1;
|
||||
@@ -91,7 +91,7 @@ public class TreeTableSourceTests : IDisposable
|
||||
[SetupFakeDriver]
|
||||
public void TestTreeTableSource_BasicExpanding_WithMouse ()
|
||||
{
|
||||
((IFakeConsoleDriver)Application.Driver!).SetBufferSize (100, 100);
|
||||
((FakeDriver)Application.Driver!).SetBufferSize (100, 100);
|
||||
|
||||
TableView tv = GetTreeTable (out _);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user