mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Fixed ThicknessTests
This commit is contained in:
@@ -289,10 +289,10 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
View v = GetCanvas (out LineCanvas lc);
|
||||
v.Width = 10;
|
||||
v.Height = 10;
|
||||
v.Viewport = new Rectangle (0, 0, 10, 10);
|
||||
v.Viewport = new (0, 0, 10, 10);
|
||||
|
||||
lc.AddLine (new Point (x1, y1), len1, o1, s1);
|
||||
lc.AddLine (new Point (x2, y2), len2, o2, s2);
|
||||
lc.AddLine (new (x1, y1), len1, o1, s1);
|
||||
lc.AddLine (new (x2, y2), len2, o2, s2);
|
||||
|
||||
TestHelpers.AssertEqual (output, expected, lc.ToString ());
|
||||
v.Dispose ();
|
||||
@@ -374,10 +374,10 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
)
|
||||
{
|
||||
var canvas = new LineCanvas ();
|
||||
canvas.AddLine (new Point (x, y), length, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new Point (x, y), length, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (x, y), length, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new (x, y), length, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Viewport);
|
||||
Assert.Equal (new (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Viewport);
|
||||
}
|
||||
|
||||
[InlineData (
|
||||
@@ -456,9 +456,9 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
)
|
||||
{
|
||||
var canvas = new LineCanvas ();
|
||||
canvas.AddLine (new Point (x, y), length, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new (x, y), length, Orientation.Horizontal, LineStyle.Single);
|
||||
|
||||
Assert.Equal (new Rectangle (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Viewport);
|
||||
Assert.Equal (new (expectedX, expectedY, expectedWidth, expectedHeight), canvas.Viewport);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -479,28 +479,28 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
// ║ ║2
|
||||
|
||||
// Add a short horiz line for ╔╡
|
||||
lc.AddLine (new Point (x, y), 2, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 2, 1), lc.Viewport);
|
||||
lc.AddLine (new (x, y), 2, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 2, 1), lc.Viewport);
|
||||
|
||||
//LHS line down
|
||||
lc.AddLine (new Point (x, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
|
||||
lc.AddLine (new (x, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 2, 2), lc.Viewport);
|
||||
|
||||
//Vertical line before Title, results in a ╡
|
||||
lc.AddLine (new Point (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new (x, y, 2, 2), lc.Viewport);
|
||||
|
||||
//Vertical line after Title, results in a ╞
|
||||
lc.AddLine (new Point (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new Rectangle (x, y, 3, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new (x, y, 3, 2), lc.Viewport);
|
||||
|
||||
// remainder of top line
|
||||
lc.AddLine (new Point (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 4, 2), lc.Viewport);
|
||||
|
||||
//RHS line down
|
||||
lc.AddLine (new Point (x + width, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + width, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 4, 2), lc.Viewport);
|
||||
|
||||
TestHelpers.AssertEqual (
|
||||
output,
|
||||
@@ -529,28 +529,28 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
// ║ ║2
|
||||
|
||||
// Add a short horiz line for ╔╡
|
||||
lc.AddLine (new Point (x, y), 2, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 2, 1), lc.Viewport);
|
||||
lc.AddLine (new (x, y), 2, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 2, 1), lc.Viewport);
|
||||
|
||||
//LHS line down
|
||||
lc.AddLine (new Point (x, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
|
||||
lc.AddLine (new (x, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 2, 2), lc.Viewport);
|
||||
|
||||
//Vertical line before Title, results in a ╡
|
||||
lc.AddLine (new Point (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new Rectangle (x, y, 2, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new (x, y, 2, 2), lc.Viewport);
|
||||
|
||||
//Vertical line after Title, results in a ╞
|
||||
lc.AddLine (new Point (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new Rectangle (x, y, 3, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
Assert.Equal (new (x, y, 3, 2), lc.Viewport);
|
||||
|
||||
// remainder of top line
|
||||
lc.AddLine (new Point (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 4, 2), lc.Viewport);
|
||||
|
||||
//RHS line down
|
||||
lc.AddLine (new Point (x + width, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new Rectangle (x, y, 4, 2), lc.Viewport);
|
||||
lc.AddLine (new (x + width, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
Assert.Equal (new (x, y, 4, 2), lc.Viewport);
|
||||
|
||||
TestHelpers.AssertEqual (
|
||||
output,
|
||||
@@ -595,7 +595,7 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
var canvas = new LineCanvas ();
|
||||
|
||||
// Add a line at 5, 5 that's has length of 1
|
||||
canvas.AddLine (new Point (x, y), 1, orientation, LineStyle.Single);
|
||||
canvas.AddLine (new (x, y), 1, orientation, LineStyle.Single);
|
||||
TestHelpers.AssertEqual (output, $"{expected}", $"{canvas}");
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
public void Length_n_Is_n_Long (int x, int y, int length, Orientation orientation, string expected)
|
||||
{
|
||||
var canvas = new LineCanvas ();
|
||||
canvas.AddLine (new Point (x, y), length, orientation, LineStyle.Single);
|
||||
canvas.AddLine (new (x, y), length, orientation, LineStyle.Single);
|
||||
|
||||
var result = canvas.ToString ();
|
||||
TestHelpers.AssertEqual (output, expected, result);
|
||||
@@ -751,12 +751,12 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// outer box
|
||||
canvas.AddLine (Point.Empty, 10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, LineStyle.Heavy);
|
||||
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -781,12 +781,12 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// outer box
|
||||
canvas.AddLine (Point.Empty, 10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, thinStyle);
|
||||
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, LineStyle.Heavy);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -812,12 +812,12 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// outer box
|
||||
canvas.AddLine (Point.Empty, 10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, LineStyle.Heavy);
|
||||
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, LineStyle.Heavy);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, thinStyle);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -842,7 +842,7 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// Upper box
|
||||
canvas.AddLine (Point.Empty, 2, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new Point (0, 1), -2, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (0, 1), -2, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
var looksLike =
|
||||
@"
|
||||
@@ -861,7 +861,7 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
canvas.AddLine (Point.Empty, 1, Orientation.Horizontal, LineStyle.Single);
|
||||
|
||||
// Bottom ─
|
||||
canvas.AddLine (new Point (1, 1), -1, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new (1, 1), -1, Orientation.Horizontal, LineStyle.Single);
|
||||
|
||||
//// Right down
|
||||
//canvas.AddLine (new Point (9, 0), 3, Orientation.Vertical, LineStyle.Single);
|
||||
@@ -872,7 +872,7 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
//// Left Up
|
||||
//canvas.AddLine (new Point (0, 3), -3, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
Assert.Equal (new Rectangle (0, 0, 2, 2), canvas.Viewport);
|
||||
Assert.Equal (new (0, 0, 2, 2), canvas.Viewport);
|
||||
|
||||
Dictionary<Point, Rune> map = canvas.GetMap ();
|
||||
Assert.Equal (2, map.Count);
|
||||
@@ -909,7 +909,7 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
public void ToString_Positive_Horizontal_1Line_Offset (int x, int y, string expected)
|
||||
{
|
||||
var lc = new LineCanvas ();
|
||||
lc.AddLine (new Point (x, y), 3, Orientation.Horizontal, LineStyle.Double);
|
||||
lc.AddLine (new (x, y), 3, Orientation.Horizontal, LineStyle.Double);
|
||||
TestHelpers.AssertEqual (output, expected, $"{lc}");
|
||||
}
|
||||
|
||||
@@ -932,8 +932,8 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
public void ToString_Positive_Horizontal_2Line_Offset (int x1, int y1, int x2, int y2, string expected)
|
||||
{
|
||||
var lc = new LineCanvas ();
|
||||
lc.AddLine (new Point (x1, y1), 3, Orientation.Horizontal, LineStyle.Double);
|
||||
lc.AddLine (new Point (x2, y2), 3, Orientation.Horizontal, LineStyle.Double);
|
||||
lc.AddLine (new (x1, y1), 3, Orientation.Horizontal, LineStyle.Double);
|
||||
lc.AddLine (new (x2, y2), 3, Orientation.Horizontal, LineStyle.Double);
|
||||
|
||||
TestHelpers.AssertEqual (output, expected, $"{lc}");
|
||||
}
|
||||
@@ -989,9 +989,9 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
View v = GetCanvas (out LineCanvas lc);
|
||||
v.Width = 10;
|
||||
v.Height = 10;
|
||||
v.Viewport = new Rectangle (0, 0, 10, 10);
|
||||
v.Viewport = new (0, 0, 10, 10);
|
||||
|
||||
lc.AddLine (new Point (x1, y1), length, o1, s1);
|
||||
lc.AddLine (new (x1, y1), length, o1, s1);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -1028,7 +1028,7 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
{
|
||||
View v = GetCanvas (out LineCanvas canvas);
|
||||
canvas.AddLine (Point.Empty, 2, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new Point (0, 1), 2, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (0, 1), 2, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -1119,12 +1119,12 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// outer box
|
||||
canvas.AddLine (Point.Empty, 10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, LineStyle.Double);
|
||||
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, LineStyle.Double);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -1149,12 +1149,12 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// outer box
|
||||
canvas.AddLine (Point.Empty, 10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, thinStyle);
|
||||
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, LineStyle.Double);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, thinStyle);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, LineStyle.Double);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -1186,13 +1186,13 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// LineStyle.Single is ignored because corner overlaps with the above line which is Rounded
|
||||
// this results in a rounded corner being used.
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, LineStyle.Rounded);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, LineStyle.Rounded);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
// These lines say rounded but they will result in the T sections which are never rounded.
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, LineStyle.Rounded);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, LineStyle.Rounded);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, LineStyle.Rounded);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, LineStyle.Rounded);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -1217,12 +1217,12 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// outer box
|
||||
canvas.AddLine (Point.Empty, 10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, LineStyle.Double);
|
||||
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, thinStyle);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, LineStyle.Double);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, thinStyle);
|
||||
|
||||
v.Draw ();
|
||||
|
||||
@@ -1247,13 +1247,13 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// Frame
|
||||
canvas.AddLine (Point.Empty, 10, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new Point (9, 0), 5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new Point (9, 4), -10, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new Point (0, 4), -5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (9, 0), 5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (9, 4), -10, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new (0, 4), -5, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
// Cross
|
||||
canvas.AddLine (new Point (5, 0), 5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new Point (0, 2), 10, Orientation.Horizontal, LineStyle.Single);
|
||||
canvas.AddLine (new (5, 0), 5, Orientation.Vertical, LineStyle.Single);
|
||||
canvas.AddLine (new (0, 2), 10, Orientation.Horizontal, LineStyle.Single);
|
||||
|
||||
var looksLike =
|
||||
@"
|
||||
@@ -1280,22 +1280,22 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
|
||||
// ╔╡╞═════╗
|
||||
// Add a short horiz line for ╔╡
|
||||
lc.AddLine (new Point (x, y), 2, Orientation.Horizontal, LineStyle.Double);
|
||||
lc.AddLine (new (x, y), 2, Orientation.Horizontal, LineStyle.Double);
|
||||
|
||||
//LHS line down
|
||||
lc.AddLine (new Point (x, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
lc.AddLine (new (x, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
|
||||
//Vertical line before Title, results in a ╡
|
||||
lc.AddLine (new Point (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
lc.AddLine (new (x + 1, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
//Vertical line after Title, results in a ╞
|
||||
lc.AddLine (new Point (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
lc.AddLine (new (x + 2, y), 0, Orientation.Vertical, LineStyle.Single);
|
||||
|
||||
// remainder of top line
|
||||
lc.AddLine (new Point (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
|
||||
lc.AddLine (new (x + 2, y), width - 1, Orientation.Horizontal, LineStyle.Double);
|
||||
|
||||
//RHS line down
|
||||
lc.AddLine (new Point (x + width, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
lc.AddLine (new (x + width, y), height, Orientation.Vertical, LineStyle.Double);
|
||||
|
||||
var looksLike = @"
|
||||
╔╡╞══╗
|
||||
@@ -1314,9 +1314,9 @@ public class LineCanvasTests (ITestOutputHelper output)
|
||||
/// <returns></returns>
|
||||
private View GetCanvas (out LineCanvas canvas, int offsetX = 0, int offsetY = 0)
|
||||
{
|
||||
var v = new View { Width = 10, Height = 5, Viewport = new Rectangle (0, 0, 10, 5) };
|
||||
var v = new View { Width = 10, Height = 5, Viewport = new (0, 0, 10, 5) };
|
||||
|
||||
LineCanvas canvasCopy = canvas = new LineCanvas ();
|
||||
LineCanvas canvasCopy = canvas = new ();
|
||||
|
||||
v.DrawContentComplete += (s, e) =>
|
||||
{
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
using System.Text;
|
||||
using Xunit.Abstractions;
|
||||
|
||||
//using GraphViewTests = Terminal.Gui.Views.GraphViewTests;
|
||||
|
||||
// Alias Console to MockConsole so we don't accidentally use Console
|
||||
|
||||
namespace Terminal.Gui.DrawingTests;
|
||||
|
||||
public class ThicknessTests
|
||||
public class ThicknessTests (ITestOutputHelper output)
|
||||
{
|
||||
private readonly ITestOutputHelper _output;
|
||||
public ThicknessTests (ITestOutputHelper output) { _output = output; }
|
||||
|
||||
[Fact]
|
||||
public void Constructor_Defaults ()
|
||||
{
|
||||
@@ -73,7 +66,7 @@ public class ThicknessTests
|
||||
TestHelpers.AssertDriverContentsWithFrameAre (
|
||||
@"
|
||||
Test (Left=0,Top=0,Right=0,Bottom=0)",
|
||||
_output
|
||||
output
|
||||
);
|
||||
|
||||
t = new Thickness (1, 1, 1, 1);
|
||||
@@ -104,7 +97,7 @@ public class ThicknessTests
|
||||
T T
|
||||
T T
|
||||
TTTest (Left=1,Top=1,Right=1,Bottom=1)TT",
|
||||
_output
|
||||
output
|
||||
);
|
||||
|
||||
t = new Thickness (1, 2, 3, 4);
|
||||
@@ -135,7 +128,7 @@ public class ThicknessTests
|
||||
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
|
||||
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
|
||||
TTTest (Left=1,Top=2,Right=3,Bottom=4)TT",
|
||||
_output
|
||||
output
|
||||
);
|
||||
|
||||
t = new Thickness (-1, 1, 1, 1);
|
||||
@@ -166,7 +159,7 @@ public class ThicknessTests
|
||||
T
|
||||
T
|
||||
TTest (Left=-1,Top=1,Right=1,Bottom=1)TT",
|
||||
_output
|
||||
output
|
||||
);
|
||||
}
|
||||
|
||||
@@ -211,7 +204,7 @@ public class ThicknessTests
|
||||
│ │
|
||||
│ │
|
||||
└───────────────────────────────────────────┘",
|
||||
_output
|
||||
output
|
||||
);
|
||||
|
||||
t = new Thickness (1, 1, 1, 1);
|
||||
@@ -243,7 +236,7 @@ public class ThicknessTests
|
||||
│ │
|
||||
│ │
|
||||
└───────────────────────────────────────────┘",
|
||||
_output
|
||||
output
|
||||
);
|
||||
|
||||
t = new Thickness (1, 2, 3, 4);
|
||||
@@ -275,7 +268,7 @@ public class ThicknessTests
|
||||
│ │
|
||||
│ │
|
||||
└───────────────────────────────────────────┘",
|
||||
_output
|
||||
output
|
||||
);
|
||||
|
||||
t = new Thickness (-1, 1, 1, 1);
|
||||
@@ -307,7 +300,7 @@ public class ThicknessTests
|
||||
│ 2
|
||||
│ 3
|
||||
└────|123456789|123456789|123456789|123456789",
|
||||
_output
|
||||
output
|
||||
);
|
||||
top.Dispose ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user