Fixes #4374 - Nukes all (?) legacy Driver and Application stuff; revamps tests (#4376)

This commit is contained in:
Tig
2025-11-11 16:29:33 -07:00
committed by GitHub
parent 559dea9239
commit d53fcd7485
310 changed files with 14827 additions and 16911 deletions

View File

@@ -6,7 +6,7 @@ using Xunit.Abstractions;
namespace UnitTests;
/// <summary>
/// Provides xUnit-style assertions for <see cref="IConsoleDriver"/> contents.
/// Provides xUnit-style assertions for <see cref="IDriver"/> contents.
/// </summary>
internal partial class DriverAssert
{
@@ -25,12 +25,12 @@ internal partial class DriverAssert
/// <paramref name="expectedAttributes"/>.
/// </param>
/// <param name="output"></param>
/// <param name="driver">The IConsoleDriver to use. If null <see cref="Application.Driver"/> will be used.</param>
/// <param name="driver">The IDriver to use. If null <see cref="Application.Driver"/> will be used.</param>
/// <param name="expectedAttributes"></param>
public static void AssertDriverAttributesAre (
string expectedLook,
ITestOutputHelper output,
IConsoleDriver? driver = null,
IDriver? driver = null,
params Attribute [] expectedAttributes
)
{
@@ -142,12 +142,12 @@ internal partial class DriverAssert
/// <summary>Asserts that the driver contents match the expected contents, optionally ignoring any trailing whitespace.</summary>
/// <param name="expectedLook"></param>
/// <param name="output"></param>
/// <param name="driver">The IConsoleDriver to use. If null <see cref="Application.Driver"/> will be used.</param>
/// <param name="driver">The IDriver to use. If null <see cref="Application.Driver"/> will be used.</param>
/// <param name="ignoreLeadingWhitespace"></param>
public static void AssertDriverContentsAre (
string expectedLook,
ITestOutputHelper output,
IConsoleDriver? driver = null,
IDriver? driver = null,
bool ignoreLeadingWhitespace = false
)
{
@@ -188,12 +188,12 @@ internal partial class DriverAssert
/// </summary>
/// <param name="expectedLook"></param>
/// <param name="output"></param>
/// <param name="driver">The IConsoleDriver to use. If null <see cref="Application.Driver"/> will be used.</param>
/// <param name="driver">The IDriver to use. If null <see cref="Application.Driver"/> will be used.</param>
/// <returns></returns>
public static Rectangle AssertDriverContentsWithFrameAre (
string expectedLook,
ITestOutputHelper output,
IConsoleDriver? driver = null
IDriver? driver = null
)
{
List<List<Rune>> lines = [];
@@ -339,7 +339,7 @@ internal partial class DriverAssert
/// </summary>
/// <param name="driver">if null uses <see cref="Application.Driver"/></param>
/// <param name="expectedColors"></param>
internal static void AssertDriverUsedColors (IConsoleDriver? driver = null, params Attribute [] expectedColors)
internal static void AssertDriverUsedColors (IDriver? driver = null, params Attribute [] expectedColors)
{
driver ??= Application.Driver;
Cell [,] contents = driver?.Contents!;