mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
// Alias Console to MockConsole so we don't accidentally use Console
|
||||
|
||||
using UnitTests;
|
||||
|
||||
namespace UnitTests_Parallelizable.DrawingTests;
|
||||
|
||||
public class AttributeTests
|
||||
public class AttributeTests : FakeDriverBase
|
||||
{
|
||||
[Fact]
|
||||
public void Constructor_ParsesNamedColorsAndStyle ()
|
||||
@@ -36,7 +38,7 @@ public class AttributeTests
|
||||
public void Constructor_DefaultsToNoneStyle_WhenStyleIsNullOrEmpty ()
|
||||
{
|
||||
var attr1 = new Attribute ("White", "Black");
|
||||
var attr2 = new Attribute ("White", "Black", null);
|
||||
var attr2 = new Attribute ("White", "Black");
|
||||
var attr3 = new Attribute ("White", "Black", "");
|
||||
Assert.Equal (TextStyle.None, attr1.Style);
|
||||
Assert.Equal (TextStyle.None, attr2.Style);
|
||||
@@ -103,8 +105,7 @@ public class AttributeTests
|
||||
[Fact]
|
||||
public void Constructors_Construct ()
|
||||
{
|
||||
var driver = new FakeDriver ();
|
||||
driver.Init ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
// Test parameterless constructor
|
||||
var attr = new Attribute ();
|
||||
@@ -258,8 +259,7 @@ public class AttributeTests
|
||||
[Fact]
|
||||
public void Make_Creates ()
|
||||
{
|
||||
var driver = new FakeDriver ();
|
||||
driver.Init ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
var fg = new Color ();
|
||||
fg = new (Color.Red);
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Text;
|
||||
using UnitTests;
|
||||
using UnitTests.Parallelizable;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace UnitTests_Parallelizable.DrawingTests;
|
||||
@@ -11,7 +10,7 @@ namespace UnitTests_Parallelizable.DrawingTests;
|
||||
/// Note: Tests that verify rendered output (ToString()) cannot be parallelized because LineCanvas
|
||||
/// depends on Application.Driver for glyph resolution and configuration. Those tests remain in UnitTests.
|
||||
/// </summary>
|
||||
public class LineCanvasTests (ITestOutputHelper output) : ParallelizableBase
|
||||
public class LineCanvasTests (ITestOutputHelper output) : FakeDriverBase
|
||||
{
|
||||
#region Basic API Tests
|
||||
|
||||
@@ -548,7 +547,7 @@ public class LineCanvasTests (ITestOutputHelper output) : ParallelizableBase
|
||||
string expected
|
||||
)
|
||||
{
|
||||
IConsoleDriver driver = CreateFakeDriver ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
View v = GetCanvas (driver, out LineCanvas lc);
|
||||
v.Width = 10;
|
||||
v.Height = 10;
|
||||
@@ -1483,7 +1482,7 @@ public class LineCanvasTests (ITestOutputHelper output) : ParallelizableBase
|
||||
/// <param name="offsetX">How far to offset drawing in X</param>
|
||||
/// <param name="offsetY">How far to offset drawing in Y</param>
|
||||
/// <returns></returns>
|
||||
private View GetCanvas (IConsoleDriver driver, out LineCanvas canvas, int offsetX = 0, int offsetY = 0)
|
||||
private View GetCanvas (IDriver driver, out LineCanvas canvas, int offsetX = 0, int offsetY = 0)
|
||||
{
|
||||
var v = new View { Width = 10, Height = 5, Viewport = new (0, 0, 10, 5) };
|
||||
v.Driver = driver;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Microsoft.VisualStudio.TestPlatform.Utilities;
|
||||
using UnitTests;
|
||||
using UnitTests.Parallelizable;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace UnitTests_Parallelizable.DrawingTests;
|
||||
@@ -11,7 +10,7 @@ namespace UnitTests_Parallelizable.DrawingTests;
|
||||
///
|
||||
/// Note: Tests that verify rendered output (Draw methods) require Application.Driver and remain in UnitTests as integration tests.
|
||||
/// </summary>
|
||||
public class RulerTests (ITestOutputHelper output): ParallelizableBase
|
||||
public class RulerTests (ITestOutputHelper output) : FakeDriverBase
|
||||
{
|
||||
[Fact]
|
||||
public void Constructor_Defaults ()
|
||||
@@ -52,7 +51,7 @@ public class RulerTests (ITestOutputHelper output): ParallelizableBase
|
||||
[Fact]
|
||||
public void Draw_Default ()
|
||||
{
|
||||
IConsoleDriver driver = CreateFakeDriver ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
var r = new Ruler ();
|
||||
r.Draw (Point.Empty, driver: driver);
|
||||
@@ -62,7 +61,7 @@ public class RulerTests (ITestOutputHelper output): ParallelizableBase
|
||||
[Fact]
|
||||
public void Draw_Horizontal ()
|
||||
{
|
||||
IConsoleDriver driver = CreateFakeDriver ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
var len = 15;
|
||||
|
||||
@@ -108,7 +107,7 @@ public class RulerTests (ITestOutputHelper output): ParallelizableBase
|
||||
[Fact]
|
||||
public void Draw_Vertical ()
|
||||
{
|
||||
IConsoleDriver driver = CreateFakeDriver ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
var len = 15;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Xunit.Abstractions;
|
||||
using UnitTests;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace UnitTests.DrawingTests;
|
||||
namespace UnitTests_Parallelizable.DrawingTests;
|
||||
|
||||
public class StraightLineExtensionsTests (ITestOutputHelper output)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
using System.Text;
|
||||
using UnitTests;
|
||||
using UnitTests.Parallelizable;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
namespace UnitTests_Parallelizable.DrawingTests;
|
||||
|
||||
public class ThicknessTests (ITestOutputHelper output) : ParallelizableBase
|
||||
public class ThicknessTests (ITestOutputHelper output) : FakeDriverBase
|
||||
{
|
||||
[Fact]
|
||||
public void Constructor_Defaults ()
|
||||
@@ -625,7 +624,7 @@ public class ThicknessTests (ITestOutputHelper output) : ParallelizableBase
|
||||
[Fact]
|
||||
public void DrawTests ()
|
||||
{
|
||||
IConsoleDriver driver = new FakeDriver ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
driver.SetScreenSize (60, 40);
|
||||
|
||||
var t = new Thickness (0, 0, 0, 0);
|
||||
@@ -738,7 +737,7 @@ public class ThicknessTests (ITestOutputHelper output) : ParallelizableBase
|
||||
[Fact]
|
||||
public void DrawTests_Ruler ()
|
||||
{
|
||||
IConsoleDriver driver = new FakeDriver ();
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
// Add a frame so we can see the ruler
|
||||
var f = new FrameView { X = 0, Y = 0, Width = Dim.Fill (), Height = Dim.Fill (), BorderStyle = LineStyle.Single };
|
||||
|
||||
Reference in New Issue
Block a user