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:
copilot-swe-agent[bot]
2025-10-26 20:52:48 +00:00
parent 42bf7526e6
commit ba531af5fd
9 changed files with 465 additions and 45 deletions

View File

@@ -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);

View File

@@ -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
{

View File

@@ -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";

View File

@@ -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

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -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 _);