diff --git a/Terminal.Gui/View/ViewDrawing.cs b/Terminal.Gui/View/ViewDrawing.cs
index 262c914af..d49d4ae0b 100644
--- a/Terminal.Gui/View/ViewDrawing.cs
+++ b/Terminal.Gui/View/ViewDrawing.cs
@@ -566,8 +566,8 @@ namespace Terminal.Gui {
/// be greater or equal to the start and for and the end position must
/// be less or equal to the start.
///
- /// The view relative of the start and side position.
- /// The view relative of the end and side position.
+ /// The start and side position screen relative.
+ /// The end and side position screen relative.
/// The view relative location and size of the frame.
/// The line style.
/// The colors to be used.
@@ -582,42 +582,20 @@ namespace Terminal.Gui {
} else {
lc = LineCanvas;
}
-
- int pStart = startPos.start;
- int pEnd = endPos.end;
-
+ var start = startPos.start;
+ var end = endPos.end;
switch (startPos.side) {
case Side.Left:
- case Side.Right:
- pStart += vts.Y;
- break;
- case Side.Top:
- case Side.Bottom:
- pStart += vts.X;
- break;
- }
- switch (endPos.side) {
- case Side.Left:
- case Side.Right:
- pEnd += vts.Y;
- break;
- case Side.Top:
- case Side.Bottom:
- pEnd += vts.X;
- break;
- }
- switch (startPos.side) {
- case Side.Left:
- if (pStart == vts.Y) {
- lc.AddLine (new Point (vts.X, pStart), 1,
+ if (start == vts.Y) {
+ lc.AddLine (new Point (vts.X, start), 1,
Orientation.Vertical, lineStyle, attribute);
} else {
- if (pEnd <= pStart && startPos.side == endPos.side) {
- lc.AddLine (new Point (vts.X, pStart), pEnd - pStart - 1,
+ if (end <= start && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.X, start), end - start - 1,
Orientation.Vertical, lineStyle, attribute);
break;
} else {
- lc.AddLine (new Point (vts.X, pStart), vts.Y - pStart - 1,
+ lc.AddLine (new Point (vts.X, start), vts.Y - start - 1,
Orientation.Vertical, lineStyle, attribute);
}
}
@@ -629,19 +607,19 @@ namespace Terminal.Gui {
Orientation.Vertical, lineStyle, attribute);
lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -vts.Width,
Orientation.Horizontal, lineStyle, attribute);
- if (pEnd <= vts.Bottom - 1 && startPos.side == endPos.side) {
- lc.AddLine (new Point (vts.X, vts.Bottom - 1), -(vts.Bottom - pEnd),
+ if (end <= vts.Bottom - 1 && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.X, vts.Bottom - 1), -(vts.Bottom - end),
Orientation.Vertical, lineStyle, attribute);
}
break;
case Side.Top:
- lc.AddLine (new Point (vts.X, vts.Y), pEnd - 1,
+ lc.AddLine (new Point (vts.X, vts.Y), end,
Orientation.Horizontal, lineStyle, attribute);
break;
case Side.Right:
lc.AddLine (new Point (vts.X, vts.Y), vts.Width,
Orientation.Horizontal, lineStyle, attribute);
- lc.AddLine (new Point (vts.Right - 1, vts.Y), pEnd - 1,
+ lc.AddLine (new Point (vts.Right - 1, vts.Y), end + 1,
Orientation.Vertical, lineStyle, attribute);
break;
case Side.Bottom:
@@ -649,25 +627,23 @@ namespace Terminal.Gui {
Orientation.Horizontal, lineStyle, attribute);
lc.AddLine (new Point (vts.Right - 1, vts.Y), vts.Height,
Orientation.Vertical, lineStyle, attribute);
- lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -(vts.Right - pEnd),
+ lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -end,
Orientation.Horizontal, lineStyle, attribute);
break;
}
break;
case Side.Top:
- if (pStart == vts.Right - 1) {
- lc.AddLine (new Point (pStart, vts.Y), -1,
+ if (start == vts.Width - 1) {
+ lc.AddLine (new Point (vts.X + start, vts.Y), -1,
+ Orientation.Horizontal, lineStyle, attribute);
+ } else if (end >= start && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.X + start, vts.Y), end - start + 1,
+ Orientation.Horizontal, lineStyle, attribute);
+ break;
+ } else if (vts.Width - start > 0) {
+ lc.AddLine (new Point (vts.X + start, vts.Y), Math.Max (vts.Width - start, 0),
Orientation.Horizontal, lineStyle, attribute);
- } else {
- if (pEnd >= pStart && startPos.side == endPos.side) {
- lc.AddLine (new Point (pStart, vts.Y), pEnd - pStart + 1,
- Orientation.Horizontal, lineStyle, attribute);
- break;
- } else {
- lc.AddLine (new Point (pStart, vts.Y), vts.Right - pStart,
- Orientation.Horizontal, lineStyle, attribute);
- }
}
switch (endPos.side) {
case Side.Left:
@@ -675,7 +651,7 @@ namespace Terminal.Gui {
Orientation.Vertical, lineStyle, attribute);
lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -vts.Width,
Orientation.Horizontal, lineStyle, attribute);
- lc.AddLine (new Point (vts.X, vts.Bottom - 1), -(vts.Bottom - pEnd),
+ lc.AddLine (new Point (vts.X, vts.Bottom - 1), -end,
Orientation.Vertical, lineStyle, attribute);
break;
case Side.Top:
@@ -685,93 +661,91 @@ namespace Terminal.Gui {
Orientation.Horizontal, lineStyle, attribute);
lc.AddLine (new Point (vts.X, vts.Bottom - 1), -vts.Height,
Orientation.Vertical, lineStyle, attribute);
- if (pEnd >= vts.X && startPos.side == endPos.side) {
- lc.AddLine (new Point (vts.X, vts.Y), pEnd - vts.X + 1,
+ if (end >= 0 && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.X, vts.Y), end + 1,
Orientation.Horizontal, lineStyle, attribute);
}
break;
case Side.Right:
- lc.AddLine (new Point (vts.Right - 1, vts.Y), pEnd - pStart + 1,
+ lc.AddLine (new Point (vts.Right - 1, vts.Y), end,
Orientation.Vertical, lineStyle, attribute);
break;
case Side.Bottom:
lc.AddLine (new Point (vts.Right - 1, vts.Y), vts.Height,
Orientation.Vertical, lineStyle, attribute);
- lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -(vts.Right - pEnd),
+ lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -(vts.Width - end),
Orientation.Horizontal, lineStyle, attribute);
break;
}
break;
case Side.Right:
- if (pStart == vts.Bottom - 1) {
- lc.AddLine (new Point (vts.Right - 1, pStart), -1,
+ if (start == vts.Bottom - 1) {
+ lc.AddLine (new Point (vts.Width - 1, start), -1,
Orientation.Vertical, lineStyle, attribute);
} else {
- if (pEnd >= pStart && startPos.side == endPos.side) {
- lc.AddLine (new Point (vts.Right - 1, pStart), pEnd - pStart + 1,
+ if (end >= start && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.Width - 1, start), end - start + 1,
Orientation.Vertical, lineStyle, attribute);
break;
} else {
- lc.AddLine (new Point (vts.Right - 1, pStart), vts.Bottom - pStart,
+ lc.AddLine (new Point (vts.Width - 1, start), vts.Bottom - start,
Orientation.Vertical, lineStyle, attribute);
}
}
switch (endPos.side) {
case Side.Left:
- lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -vts.Width,
+ lc.AddLine (new Point (vts.Width - 1, vts.Bottom - 1), -vts.Width,
Orientation.Horizontal, lineStyle, attribute);
- lc.AddLine (new Point (vts.X, vts.Bottom - 1), -(vts.Bottom - pEnd),
+ lc.AddLine (new Point (vts.X, vts.Bottom - 1), -(vts.Bottom - end),
Orientation.Vertical, lineStyle, attribute);
break;
case Side.Top:
- lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -vts.Width,
+ lc.AddLine (new Point (vts.Width - 1, vts.Bottom - 1), -vts.Width,
Orientation.Horizontal, lineStyle, attribute);
lc.AddLine (new Point (vts.X, vts.Bottom - 1), -vts.Height,
Orientation.Vertical, lineStyle, attribute);
- lc.AddLine (new Point (vts.X, vts.Y), pEnd - vts.X + 1,
+ lc.AddLine (new Point (vts.X, vts.Y), end,
Orientation.Horizontal, lineStyle, attribute);
break;
case Side.Right:
- lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -vts.Width,
+ lc.AddLine (new Point (vts.Width - 1, vts.Bottom - 1), -vts.Width,
Orientation.Horizontal, lineStyle, attribute);
lc.AddLine (new Point (vts.X, vts.Bottom - 1), -vts.Height,
Orientation.Vertical, lineStyle, attribute);
lc.AddLine (new Point (vts.X, vts.Y), vts.Width,
Orientation.Horizontal, lineStyle, attribute);
- if (pEnd >= vts.Y && pEnd < vts.Bottom - 1 && startPos.side == endPos.side) {
- lc.AddLine (new Point (vts.Right - 1, vts.Y), pEnd - vts.Y + 1,
+ if (end >= 0 && end < vts.Bottom - 1 && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.Width - 1, vts.Y), end + 1,
Orientation.Vertical, lineStyle, attribute);
}
break;
case Side.Bottom:
- lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -(vts.Right - pEnd),
+ lc.AddLine (new Point (vts.Width - 1, vts.Bottom - 1), -(vts.Width - end),
Orientation.Horizontal, lineStyle, attribute);
break;
}
break;
case Side.Bottom:
- if (pStart == vts.X) {
+ if (start == vts.X) {
lc.AddLine (new Point (vts.X, vts.Bottom - 1), 1,
Orientation.Horizontal, lineStyle, attribute);
+ } else if (end <= start && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.X + start, vts.Bottom - 1), -(start - end + 1),
+ Orientation.Horizontal, lineStyle, attribute);
+ break;
} else {
- if (pEnd <= pStart && startPos.side == endPos.side) {
- lc.AddLine (new Point (pStart, vts.Bottom - 1), -(pStart - pEnd + 1),
- Orientation.Horizontal, lineStyle, attribute);
- break;
- } else {
- lc.AddLine (new Point (pStart, vts.Bottom - 1), -(pStart - 1),
- Orientation.Horizontal, lineStyle, attribute);
- }
+ lc.AddLine (new Point (vts.X + start, vts.Bottom - 1), -(start + 1),
+ Orientation.Horizontal, lineStyle, attribute);
}
switch (endPos.side) {
case Side.Left:
- lc.AddLine (new Point (vts.X, vts.Bottom - 1), -(vts.Bottom - pEnd),
+ lc.AddLine (new Point (vts.X, vts.Bottom - 1), -(vts.Bottom - end),
Orientation.Vertical, lineStyle, attribute);
break;
case Side.Top:
lc.AddLine (new Point (vts.X, vts.Bottom - 1), -vts.Height,
Orientation.Vertical, lineStyle, attribute);
- lc.AddLine (new Point (vts.X, vts.Y), pEnd - 1,
+ lc.AddLine (new Point (vts.X, vts.Y), end + 1,
Orientation.Horizontal, lineStyle, attribute);
break;
case Side.Right:
@@ -779,7 +753,7 @@ namespace Terminal.Gui {
Orientation.Vertical, lineStyle, attribute);
lc.AddLine (new Point (vts.X, vts.Y), vts.Width,
Orientation.Horizontal, lineStyle, attribute);
- lc.AddLine (new Point (vts.Right - 1, vts.Y), pEnd - 1,
+ lc.AddLine (new Point (vts.Width - 1, vts.Y), end,
Orientation.Vertical, lineStyle, attribute);
break;
case Side.Bottom:
@@ -787,10 +761,10 @@ namespace Terminal.Gui {
Orientation.Vertical, lineStyle, attribute);
lc.AddLine (new Point (vts.X, vts.Y), vts.Width,
Orientation.Horizontal, lineStyle, attribute);
- lc.AddLine (new Point (vts.Right - 1, vts.Y), vts.Height,
+ lc.AddLine (new Point (vts.Width - 1, vts.Y), vts.Height,
Orientation.Vertical, lineStyle, attribute);
- if (pEnd <= vts.Right - 1 && startPos.side == endPos.side) {
- lc.AddLine (new Point (vts.Right - 1, vts.Bottom - 1), -(vts.Right - pEnd),
+ if (vts.Width - end > 0 && startPos.side == endPos.side) {
+ lc.AddLine (new Point (vts.Width - 1, vts.Bottom - 1), -(vts.Width - end),
Orientation.Horizontal, lineStyle, attribute);
}
break;
diff --git a/UnitTests/View/DrawTests.cs b/UnitTests/View/DrawTests.cs
index 8fd0d44ce..d5fa06c77 100644
--- a/UnitTests/View/DrawTests.cs
+++ b/UnitTests/View/DrawTests.cs
@@ -375,230 +375,171 @@ t ", output);
└────────┘", output);
}
+ [Theory, AutoInitShutdown]
+ [InlineData (1, Side.Left, 5, Side.Left, @"
+┌────────┐
+│ │
+ test │
+ │
+─────────┘")]
+ [InlineData (1, Side.Left, 4, Side.Left, @"
+┌────────┐
+│ │
+ test │
+ │
+└────────┘")]
+ [InlineData (0, Side.Left, 3, Side.Left, @"
+┌────────┐
+ │
+ test │
+│ │
+└────────┘")]
+ [InlineData (5, Side.Top, -1, Side.Top, @"
+│ ────┐
+│ │
+│ test │
+│ │
+└────────┘")]
+ [InlineData (5, Side.Top, 0, Side.Top, @"
+┌ ────┐
+│ │
+│ test │
+│ │
+└────────┘")]
+ [InlineData (6, Side.Top, 1, Side.Top, @"
+┌─ ───┐
+│ │
+│ test │
+│ │
+└────────┘")]
+ [InlineData (7, Side.Top, 2, Side.Top, @"
+┌── ──┐
+│ │
+│ test │
+│ │
+└────────┘")]
+ [InlineData (8, Side.Top, 3, Side.Top, @"
+┌─── ─┐
+│ │
+│ test │
+│ │
+└────────┘")]
+ [InlineData (9, Side.Top, 4, Side.Top, @"
+┌──── ┐
+│ │
+│ test │
+│ │
+└────────┘")]
+ [InlineData (10, Side.Top, 5, Side.Top, @"
+┌───── │
+│ │
+│ test │
+│ │
+└────────┘")]
+ [InlineData (3, Side.Right, -1, Side.Right, @"
+┌─────────
+│
+│ test
+│ │
+└────────┘")]
+ [InlineData (3, Side.Right, 0, Side.Right, @"
+┌────────┐
+│
+│ test
+│ │
+└────────┘")]
+ [InlineData (4, Side.Right, 1, Side.Right, @"
+┌────────┐
+│ │
+│ test
+│
+└────────┘")]
+ [InlineData (4, Side.Bottom, 10, Side.Bottom, @"
+┌────────┐
+│ │
+│ test │
+│ │
+└──── │")]
+ [InlineData (4, Side.Bottom, 9, Side.Bottom, @"
+┌────────┐
+│ │
+│ test │
+│ │
+└──── ┘")]
+ [InlineData (3, Side.Bottom, 8, Side.Bottom, @"
+┌────────┐
+│ │
+│ test │
+│ │
+└─── ─┘")]
+ [InlineData (2, Side.Bottom, 7, Side.Bottom, @"
+┌────────┐
+│ │
+│ test │
+│ │
+└── ──┘")]
+ [InlineData (1, Side.Bottom, 6, Side.Bottom, @"
+┌────────┐
+│ │
+│ test │
+│ │
+└─ ───┘")]
+ [InlineData (0, Side.Bottom, 5, Side.Bottom, @"
+┌────────┐
+│ │
+│ test │
+│ │
+└ ────┘")]
+ [InlineData (-1, Side.Bottom, 5, Side.Bottom, @"
+┌────────┐
+│ │
+│ test │
+│ │
+│ ────┘")]
+ public void DrawIncompleteFrame_All_Sides (int start, Side startSide, int end, Side endSide, string expected)
+ {
+ View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);
+ Application.Top.Add (view);
+ Application.Begin (Application.Top);
+
+ TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
+ }
+
private static View GetViewsForDrawFrameTests (int start, Side startSide, int end, Side endSide)
{
var label = new View () { X = Pos.Center (), Y = Pos.Center (), Text = "test", AutoSize = true };
- // Using a non 0 location to avoids bugs on testing.
- var view = new View () { X = 2, Y = 2, Width = 10, Height = 5 };
+ var view = new View () { Width = 10, Height = 5 };
view.DrawContent += (s, e) =>
view.DrawIncompleteFrame (new (start, startSide), new (end, endSide), view.Bounds, LineStyle.Single);
view.Add (label);
return view;
}
- [Theory, AutoInitShutdown]
- [InlineData (3, Side.Left, 0, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- ─────────┘")]
- [InlineData (1, Side.Top, 0, Side.Left, @"
- │────────┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (1, Side.Right, 9, Side.Top, @"
- ┌─────────
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (8, Side.Bottom, 4, Side.Right, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └────────│")]
- [InlineData (0, Side.Right, 8, Side.Top, @"
- ┌────────│
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (4, Side.Left, 1, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- │────────┘")]
- [InlineData (0, Side.Top, 1, Side.Left, @"
- ─────────┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (9, Side.Bottom, 3, Side.Right, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └─────────")]
- public void DrawIncompleteFrame_All_Sides_Width_One (int start, Side startSide, int end, Side endSide, string expected)
- {
- View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);
- Application.Top.Add (view);
- Application.Begin (Application.Top);
-
- TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
- }
-
- [Theory, AutoInitShutdown]
- [InlineData (1, Side.Left, 5, Side.Left, @"
- ┌────────┐
- │ │
- test │
- │
- ─────────┘")]
- [InlineData (1, Side.Left, 4, Side.Left, @"
- ┌────────┐
- │ │
- test │
- │
- └────────┘")]
- [InlineData (0, Side.Left, 3, Side.Left, @"
- ┌────────┐
- │
- test │
- │ │
- └────────┘")]
- [InlineData (5, Side.Top, -1, Side.Top, @"
- │ ────┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (5, Side.Top, 0, Side.Top, @"
- ┌ ────┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (6, Side.Top, 1, Side.Top, @"
- ┌─ ───┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (7, Side.Top, 2, Side.Top, @"
- ┌── ──┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (8, Side.Top, 3, Side.Top, @"
- ┌─── ─┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (9, Side.Top, 4, Side.Top, @"
- ┌──── ┐
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (0, Side.Right, 5, Side.Top, @"
- ┌───── │
- │ │
- │ test │
- │ │
- └────────┘")]
- [InlineData (3, Side.Right, -1, Side.Right, @"
- ┌─────────
- │
- │ test
- │ │
- └────────┘")]
- [InlineData (3, Side.Right, 0, Side.Right, @"
- ┌────────┐
- │
- │ test
- │ │
- └────────┘")]
- [InlineData (4, Side.Right, 1, Side.Right, @"
- ┌────────┐
- │ │
- │ test
- │
- └────────┘")]
- [InlineData (4, Side.Bottom, 10, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └──── │")]
- [InlineData (4, Side.Bottom, 9, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └──── ┘")]
- [InlineData (3, Side.Bottom, 8, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └─── ─┘")]
- [InlineData (2, Side.Bottom, 7, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └── ──┘")]
- [InlineData (1, Side.Bottom, 6, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └─ ───┘")]
- [InlineData (0, Side.Bottom, 5, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- └ ────┘")]
- [InlineData (4, Side.Left, 5, Side.Bottom, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- │ ────┘")]
- public void DrawIncompleteFrame_All_Sides_Width_Greater_Than_One (int start, Side startSide, int end, Side endSide, string expected)
- {
- View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);
- Application.Top.Add (view);
- Application.Begin (Application.Top);
-
- TestHelpers.AssertDriverContentsWithFrameAre (expected, output);
- }
-
[Theory, AutoInitShutdown]
[InlineData (4, Side.Left, 4, Side.Right, @"
- ┌────────┐
- │ │
- │ test │
- │ │
- │ │")]
+┌────────┐
+│ │
+│ test │
+│ │
+│ │")]
[InlineData (0, Side.Top, 0, Side.Bottom, @"
- ─────────┐
- │
- test │
- │
- ─────────┘")]
+─────────┐
+ │
+ test │
+ │
+─────────┘")]
[InlineData (0, Side.Right, 0, Side.Left, @"
- │ │
- │ │
- │ test │
- │ │
- └────────┘")]
+│ │
+│ │
+│ test │
+│ │
+└────────┘")]
[InlineData (9, Side.Bottom, 9, Side.Top, @"
- ┌─────────
- │
- │ test
- │
- └─────────")]
+┌─────────
+│
+│ test
+│
+└─────────")]
public void DrawIncompleteFrame_Three_Full_Sides (int start, Side startSide, int end, Side endSide, string expected)
{
View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);
@@ -609,30 +550,30 @@ t ", output);
}
[Theory, AutoInitShutdown]
- [InlineData (4, Side.Left, 9, Side.Top, @"
- ┌─────────
- │
- │ test
- │
- │ ")]
- [InlineData (0, Side.Top, 4, Side.Right, @"
- ─────────┐
- │
- test │
- │
- │")]
+ [InlineData (4, Side.Left, 10, Side.Top, @"
+┌─────────
+│
+│ test
+│
+│ ")]
+ [InlineData (0, Side.Top, 5, Side.Right, @"
+─────────┐
+ │
+ test │
+ │
+ │")]
[InlineData (0, Side.Right, 0, Side.Bottom, @"
- │
- │
- test │
- │
- ─────────┘")]
+ │
+ │
+ test │
+ │
+─────────┘")]
[InlineData (9, Side.Bottom, 0, Side.Left, @"
- │
- │
- │ test
- │
- └─────────")]
+│
+│
+│ test
+│
+└─────────")]
public void DrawIncompleteFrame_Two_Full_Sides (int start, Side startSide, int end, Side endSide, string expected)
{
View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);
@@ -644,25 +585,25 @@ t ", output);
[Theory, AutoInitShutdown]
[InlineData (4, Side.Left, 0, Side.Left, @"
- │
- │
- │ test
- │
- │ ")]
+│
+│
+│ test
+│
+│ ")]
[InlineData (0, Side.Top, 9, Side.Top, @"
- ──────────
-
- test ")]
+──────────
+
+ test ")]
[InlineData (0, Side.Right, 4, Side.Right, @"
- │
- │
- test │
- │
- │")]
+ │
+ │
+ test │
+ │
+ │")]
[InlineData (9, Side.Bottom, 0, Side.Bottom, @"
- test
-
- ──────────")]
+ test
+
+──────────")]
public void DrawIncompleteFrame_One_Full_Sides (int start, Side startSide, int end, Side endSide, string expected)
{
View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);
@@ -674,25 +615,25 @@ t ", output);
[Theory, AutoInitShutdown]
[InlineData (0, Side.Bottom, 0, Side.Top, @"
- ┌
- │
- │ test
- │
- └ ")]
+┌
+│
+│ test
+│
+└ ")]
[InlineData (0, Side.Left, 0, Side.Right, @"
- ┌────────┐
-
- test ")]
+┌────────┐
+
+ test ")]
[InlineData (9, Side.Top, 9, Side.Bottom, @"
- ┐
- │
- test │
- │
- ┘")]
+ ┐
+ │
+ test │
+ │
+ ┘")]
[InlineData (4, Side.Right, 4, Side.Left, @"
- test
-
- └────────┘")]
+ test
+
+└────────┘")]
public void DrawIncompleteFrame_One_Full_Sides_With_Corner (int start, Side startSide, int end, Side endSide, string expected)
{
View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);
@@ -704,17 +645,17 @@ t ", output);
[Theory, AutoInitShutdown]
[InlineData (2, Side.Left, 2, Side.Left, @"
- │ test")]
+│ test")]
[InlineData (3, Side.Top, 6, Side.Top, @"
- ────
-
- test")]
+ ────
+
+ test")]
[InlineData (2, Side.Right, 2, Side.Right, @"
- test │")]
+ test │")]
[InlineData (6, Side.Bottom, 3, Side.Bottom, @"
- test
-
- ────")]
+ test
+
+ ────")]
public void DrawIncompleteFrame_One_Part_Sides (int start, Side startSide, int end, Side endSide, string expected)
{
View view = GetViewsForDrawFrameTests (start, startSide, end, endSide);