("Age?"));
// Then
- console.Lines.Count.ShouldBe(3);
- console.Lines[0].ShouldBe("Age? ninety-nine");
- console.Lines[1].ShouldBe("Invalid input");
- console.Lines[2].ShouldBe("Age? 99");
+ return Verifier.Verify(console.Lines);
}
[Fact]
- public void Should_Chose_Default_Value_If_Nothing_Is_Entered()
+ public Task Should_Chose_Default_Value_If_Nothing_Is_Entered()
{
// Given
var console = new PlainConsole();
@@ -39,12 +38,11 @@ namespace Spectre.Console.Tests.Unit
.DefaultValue("Banana"));
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("Favorite fruit? [Banana/Orange] (Banana): Banana");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Return_Error_If_An_Invalid_Choice_Is_Made()
+ public Task Should_Return_Error_If_An_Invalid_Choice_Is_Made()
{
// Given
var console = new PlainConsole();
@@ -59,14 +57,11 @@ namespace Spectre.Console.Tests.Unit
.DefaultValue("Banana"));
// Then
- console.Lines.Count.ShouldBe(3);
- console.Lines[0].ShouldBe("Favorite fruit? [Banana/Orange] (Banana): Apple");
- console.Lines[1].ShouldBe("Please select one of the available options");
- console.Lines[2].ShouldBe("Favorite fruit? [Banana/Orange] (Banana): Banana");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Accept_Choice_In_List()
+ public Task Should_Accept_Choice_In_List()
{
// Given
var console = new PlainConsole();
@@ -80,12 +75,11 @@ namespace Spectre.Console.Tests.Unit
.DefaultValue("Banana"));
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("Favorite fruit? [Banana/Orange] (Banana): Orange");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Return_Error_If_Custom_Validation_Fails()
+ public Task Should_Return_Error_If_Custom_Validation_Fails()
{
// Given
var console = new PlainConsole();
@@ -113,14 +107,7 @@ namespace Spectre.Console.Tests.Unit
}));
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe("Guess number: 22");
- console.Lines[1].ShouldBe("Too low");
- console.Lines[2].ShouldBe("Guess number: 102");
- console.Lines[3].ShouldBe("Too high");
- console.Lines[4].ShouldBe("Guess number: ABC");
- console.Lines[5].ShouldBe("Invalid input");
- console.Lines[6].ShouldBe("Guess number: 99");
+ return Verifier.Verify(console.Output);
}
}
}
diff --git a/src/Spectre.Console.Tests/Unit/RecorderTests.Should_Export_Html_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/RecorderTests.Should_Export_Html_As_Expected.verified.txt
new file mode 100644
index 0000000..5e20bc3
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RecorderTests.Should_Export_Html_As_Expected.verified.txt
@@ -0,0 +1,10 @@
+
+┌─────────────────┬───────┬─────┐
+│ Foo │ Bar │ Qux │
+├─────────────────┼───────┼─────┤
+│ Corgi │ Waldo │ Zap │
+│ ╭─────────────╮ │ │ │
+│ │ Hello World │ │ │ │
+│ ╰─────────────╯ │ │ │
+└─────────────────┴───────┴─────┘
+
\ No newline at end of file
diff --git a/src/Spectre.Console.Tests/Unit/RecorderTests.Should_Export_Text_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/RecorderTests.Should_Export_Text_As_Expected.verified.txt
new file mode 100644
index 0000000..d4e2fff
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RecorderTests.Should_Export_Text_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+┌─────────────────┬───────┬─────┐
+│ Foo │ Bar │ Qux │
+├─────────────────┼───────┼─────┤
+│ Corgi │ Waldo │ Zap │
+│ ╭─────────────╮ │ │ │
+│ │ Hello World │ │ │ │
+│ ╰─────────────╯ │ │ │
+└─────────────────┴───────┴─────┘
\ No newline at end of file
diff --git a/src/Spectre.Console.Tests/Unit/RecorderTests.cs b/src/Spectre.Console.Tests/Unit/RecorderTests.cs
index 96cfd0c..4b4715c 100644
--- a/src/Spectre.Console.Tests/Unit/RecorderTests.cs
+++ b/src/Spectre.Console.Tests/Unit/RecorderTests.cs
@@ -1,12 +1,14 @@
-using Shouldly;
+using System.Threading.Tasks;
+using VerifyXunit;
using Xunit;
namespace Spectre.Console.Tests.Unit
{
+ [UsesVerify]
public sealed class RecorderTests
{
[Fact]
- public void Should_Export_Text_As_Expected()
+ public Task Should_Export_Text_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -18,22 +20,14 @@ namespace Spectre.Console.Tests.Unit
.AddRow(new Panel("Hello World").RoundedBorder()));
// When
- var result = recorder.ExportText().Split(new[] { '\n' });
+ var result = recorder.ExportText();
// Then
- result.Length.ShouldBe(8);
- result[0].ShouldBe("┌─────────────────┬───────┬─────┐");
- result[1].ShouldBe("│ Foo │ Bar │ Qux │");
- result[2].ShouldBe("├─────────────────┼───────┼─────┤");
- result[3].ShouldBe("│ Corgi │ Waldo │ Zap │");
- result[4].ShouldBe("│ ╭─────────────╮ │ │ │");
- result[5].ShouldBe("│ │ Hello World │ │ │ │");
- result[6].ShouldBe("│ ╰─────────────╯ │ │ │");
- result[7].ShouldBe("└─────────────────┴───────┴─────┘");
+ return Verifier.Verify(result);
}
[Fact]
- public void Should_Export_Html_As_Expected()
+ public Task Should_Export_Html_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -46,21 +40,10 @@ namespace Spectre.Console.Tests.Unit
.BorderColor(Color.Red).RoundedBorder()));
// When
- var html = recorder.ExportHtml();
- var result = html.Split(new[] { '\n' });
+ var result = recorder.ExportHtml();
// Then
- result.Length.ShouldBe(10);
- result[0].ShouldBe("");
- result[1].ShouldBe("┌─────────────────┬───────┬─────┐");
- result[2].ShouldBe("│ Foo │ Bar │ Qux │");
- result[3].ShouldBe("├─────────────────┼───────┼─────┤");
- result[4].ShouldBe("│ Corgi │ Waldo │ Zap │");
- result[5].ShouldBe("│ ╭─────────────╮ │ │ │");
- result[6].ShouldBe("│ │ Hello World │ │ │ │");
- result[7].ShouldBe("│ ╰─────────────╯ │ │ │");
- result[8].ShouldBe("└─────────────────┴───────┴─────┘");
- result[9].ShouldBe("
");
+ return Verifier.Verify(result);
}
}
}
diff --git a/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows.verified.txt b/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows.verified.txt
new file mode 100644
index 0000000..f8bc206
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows.verified.txt
@@ -0,0 +1,7 @@
+Hello
+┌─────┬─────┐
+│ Foo │ Bar │
+├─────┼─────┤
+│ Baz │ Qux │
+└─────┴─────┘
+World
diff --git a/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows_Correctly_Inside_Other_Widget.verified.txt b/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows_Correctly_Inside_Other_Widget.verified.txt
new file mode 100644
index 0000000..d17b85c
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows_Correctly_Inside_Other_Widget.verified.txt
@@ -0,0 +1,7 @@
+┌─────────────┬─────┐
+│ Foo │ Bar │
+├─────────────┼─────┤
+│ HELLO WORLD │ │
+│ Hello │ Qux │
+│ World │ │
+└─────────────┴─────┘
diff --git a/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows_Correctly_Inside_Other_Widget_When_Expanded.verified.txt b/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows_Correctly_Inside_Other_Widget_When_Expanded.verified.txt
new file mode 100644
index 0000000..ff66761
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RowsTests.Should_Render_Rows_Correctly_Inside_Other_Widget_When_Expanded.verified.txt
@@ -0,0 +1,7 @@
+┌────────────────────────────────────────────────────┬─────┐
+│ Foo │ Bar │
+├────────────────────────────────────────────────────┼─────┤
+│ HELLO WORLD │ │
+│ Hello │ Qux │
+│ World │ │
+└────────────────────────────────────────────────────┴─────┘
diff --git a/src/Spectre.Console.Tests/Unit/RowsTests.cs b/src/Spectre.Console.Tests/Unit/RowsTests.cs
index 3b57a12..61cdf41 100644
--- a/src/Spectre.Console.Tests/Unit/RowsTests.cs
+++ b/src/Spectre.Console.Tests/Unit/RowsTests.cs
@@ -1,13 +1,15 @@
-using Shouldly;
+using System.Threading.Tasks;
using Spectre.Console.Rendering;
+using VerifyXunit;
using Xunit;
namespace Spectre.Console.Tests.Unit
{
+ [UsesVerify]
public sealed class RowsTests
{
[Fact]
- public void Should_Render_Rows()
+ public Task Should_Render_Rows()
{
// Given
var console = new PlainConsole(width: 60);
@@ -25,18 +27,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(rows);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe("Hello");
- console.Lines[1].ShouldBe("┌─────┬─────┐");
- console.Lines[2].ShouldBe("│ Foo │ Bar │");
- console.Lines[3].ShouldBe("├─────┼─────┤");
- console.Lines[4].ShouldBe("│ Baz │ Qux │");
- console.Lines[5].ShouldBe("└─────┴─────┘");
- console.Lines[6].ShouldBe("World");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Rows_Correctly_Inside_Other_Widget()
+ public Task Should_Render_Rows_Correctly_Inside_Other_Widget()
{
// Given
var console = new PlainConsole(width: 60);
@@ -54,18 +49,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe("┌─────────────┬─────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │");
- console.Lines[2].ShouldBe("├─────────────┼─────┤");
- console.Lines[3].ShouldBe("│ HELLO WORLD │ │");
- console.Lines[4].ShouldBe("│ Hello │ Qux │");
- console.Lines[5].ShouldBe("│ World │ │");
- console.Lines[6].ShouldBe("└─────────────┴─────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Rows_Correctly_Inside_Other_Widget_When_Expanded()
+ public Task Should_Render_Rows_Correctly_Inside_Other_Widget_When_Expanded()
{
// Given
var console = new PlainConsole(width: 60);
@@ -83,14 +71,7 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe("┌────────────────────────────────────────────────────┬─────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │");
- console.Lines[2].ShouldBe("├────────────────────────────────────────────────────┼─────┤");
- console.Lines[3].ShouldBe("│ HELLO WORLD │ │");
- console.Lines[4].ShouldBe("│ Hello │ Qux │");
- console.Lines[5].ShouldBe("│ World │ │");
- console.Lines[6].ShouldBe("└────────────────────────────────────────────────────┴─────┘");
+ return Verifier.Verify(console.Output);
}
}
}
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Convert_Line_Breaks_In_Title_To_Spaces.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Convert_Line_Breaks_In_Title_To_Spaces.verified.txt
new file mode 100644
index 0000000..e5bdadd
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Convert_Line_Breaks_In_Title_To_Spaces.verified.txt
@@ -0,0 +1 @@
+──────────── Hello World ! ─────────────
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Specified_Box.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Specified_Box.verified.txt
new file mode 100644
index 0000000..cd15005
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Specified_Box.verified.txt
@@ -0,0 +1 @@
+════════════════════════════════════════
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Centered_By_Default.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Centered_By_Default.verified.txt
new file mode 100644
index 0000000..5e2f41d
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Centered_By_Default.verified.txt
@@ -0,0 +1 @@
+───────────── Hello World ──────────────
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Left_Aligned.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Left_Aligned.verified.txt
new file mode 100644
index 0000000..33602ea
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Left_Aligned.verified.txt
@@ -0,0 +1 @@
+── Hello World ─────────────────────────
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Right_Aligned.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Right_Aligned.verified.txt
new file mode 100644
index 0000000..f1ae559
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_With_Title_Right_Aligned.verified.txt
@@ -0,0 +1 @@
+───────────────────────── Hello World ──
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_Without_Title.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_Without_Title.verified.txt
new file mode 100644
index 0000000..34f1021
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_Default_Rule_Without_Title.verified.txt
@@ -0,0 +1 @@
+────────────────────────────────────────
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_With_Specified_Box.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_With_Specified_Box.verified.txt
new file mode 100644
index 0000000..dc02bb7
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Render_With_Specified_Box.verified.txt
@@ -0,0 +1 @@
+═════════════ Hello World ══════════════
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.Should_Truncate_Title.verified.txt b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Truncate_Title.verified.txt
new file mode 100644
index 0000000..5e2f41d
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.Should_Truncate_Title.verified.txt
@@ -0,0 +1 @@
+───────────── Hello World ──────────────
diff --git a/src/Spectre.Console.Tests/Unit/RuleTests.cs b/src/Spectre.Console.Tests/Unit/RuleTests.cs
index a39113b..1289a7a 100644
--- a/src/Spectre.Console.Tests/Unit/RuleTests.cs
+++ b/src/Spectre.Console.Tests/Unit/RuleTests.cs
@@ -1,12 +1,15 @@
+using System.Threading.Tasks;
using Shouldly;
+using VerifyXunit;
using Xunit;
namespace Spectre.Console.Tests.Unit
{
+ [UsesVerify]
public sealed class RuleTests
{
[Fact]
- public void Should_Render_Default_Rule_Without_Title()
+ public Task Should_Render_Default_Rule_Without_Title()
{
// Given
var console = new PlainConsole(width: 40);
@@ -15,12 +18,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(new Rule());
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("────────────────────────────────────────");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Default_Rule_With_Specified_Box()
+ public Task Should_Render_Default_Rule_With_Specified_Box()
{
// Given
var console = new PlainConsole(width: 40);
@@ -29,12 +31,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(new Rule().DoubleBorder());
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("════════════════════════════════════════");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_With_Specified_Box()
+ public Task Should_Render_With_Specified_Box()
{
// Given
var console = new PlainConsole(width: 40);
@@ -43,12 +44,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(new Rule("Hello World").DoubleBorder());
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("═════════════ Hello World ══════════════");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Default_Rule_With_Title_Centered_By_Default()
+ public Task Should_Render_Default_Rule_With_Title_Centered_By_Default()
{
// Given
var console = new PlainConsole(width: 40);
@@ -57,12 +57,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(new Rule("Hello World"));
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("───────────── Hello World ──────────────");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Default_Rule_With_Title_Left_Aligned()
+ public Task Should_Render_Default_Rule_With_Title_Left_Aligned()
{
// Given
var console = new PlainConsole(width: 40);
@@ -74,12 +73,11 @@ namespace Spectre.Console.Tests.Unit
});
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("── Hello World ─────────────────────────");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Default_Rule_With_Title_Right_Aligned()
+ public Task Should_Render_Default_Rule_With_Title_Right_Aligned()
{
// Given
var console = new PlainConsole(width: 40);
@@ -91,12 +89,11 @@ namespace Spectre.Console.Tests.Unit
});
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("───────────────────────── Hello World ──");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Convert_Line_Breaks_In_Title_To_Spaces()
+ public Task Should_Convert_Line_Breaks_In_Title_To_Spaces()
{
// Given
var console = new PlainConsole(width: 40);
@@ -105,12 +102,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(new Rule("Hello\nWorld\r\n!"));
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("──────────── Hello World ! ─────────────");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Truncate_Title()
+ public Task Should_Truncate_Title()
{
// Given
var console = new PlainConsole(width: 40);
@@ -119,8 +115,7 @@ namespace Spectre.Console.Tests.Unit
console.Render(new Rule(" Hello World "));
// Then
- console.Lines.Count.ShouldBe(1);
- console.Lines[0].ShouldBe("───────────── Hello World ──────────────");
+ return Verifier.Verify(console.Output);
}
[Theory]
diff --git a/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitLinesMethod.Should_Split_Segment.verified.txt b/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitLinesMethod.Should_Split_Segment.verified.txt
new file mode 100644
index 0000000..7fb65eb
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitLinesMethod.Should_Split_Segment.verified.txt
@@ -0,0 +1,43 @@
+[
+ [
+ {
+ Text: Foo,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ },
+ {
+ Text: Bar,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ }
+ ],
+ [
+ {
+ Text: Baz,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ },
+ {
+ Text: Qux,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ }
+ ],
+ [
+ {
+ Text: Corgi,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ }
+ ]
+]
\ No newline at end of file
diff --git a/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitLinesMethod.Should_Split_Segments_With_Linebreak_In_Text.verified.txt b/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitLinesMethod.Should_Split_Segments_With_Linebreak_In_Text.verified.txt
new file mode 100644
index 0000000..626d3e6
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitLinesMethod.Should_Split_Segments_With_Linebreak_In_Text.verified.txt
@@ -0,0 +1,45 @@
+[
+ [
+ {
+ Text: Foo,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ }
+ ],
+ [
+ {
+ Text: Bar,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ }
+ ],
+ [
+ {
+ Text: Baz,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ },
+ {
+ Text: Qux,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ }
+ ],
+ [
+ {
+ Text: Corgi,
+ Style: {
+ Foreground: {},
+ Background: {}
+ }
+ }
+ ]
+]
\ No newline at end of file
diff --git a/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitMethod.Should_Split_Segment_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitMethod.Should_Split_Segment_Correctly.verified.txt
new file mode 100644
index 0000000..c166de8
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/SegmentTests.TheSplitMethod.Should_Split_Segment_Correctly.verified.txt
@@ -0,0 +1,26 @@
+{
+ Item1: {
+ Text: Foo,
+ Style: {
+ Foreground: {
+ R: 255
+ },
+ Background: {
+ G: 128
+ },
+ Decoration: Bold
+ }
+ },
+ Item2: {
+ Text: Bar,
+ Style: {
+ Foreground: {
+ R: 255
+ },
+ Background: {
+ G: 128
+ },
+ Decoration: Bold
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Spectre.Console.Tests/Unit/SegmentTests.cs b/src/Spectre.Console.Tests/Unit/SegmentTests.cs
index f3cf5f9..5177747 100644
--- a/src/Spectre.Console.Tests/Unit/SegmentTests.cs
+++ b/src/Spectre.Console.Tests/Unit/SegmentTests.cs
@@ -1,6 +1,8 @@
using System.Text;
+using System.Threading.Tasks;
using Shouldly;
using Spectre.Console.Rendering;
+using VerifyXunit;
using Xunit;
namespace Spectre.Console.Tests.Unit
@@ -17,30 +19,29 @@ namespace Spectre.Console.Tests.Unit
result.ShouldBe(4);
}
+ [UsesVerify]
public sealed class TheSplitMethod
{
[Fact]
- public void Should_Split_Segment_Correctly()
+ public Task Should_Split_Segment_Correctly()
{
// Given
var style = new Style(Color.Red, Color.Green, Decoration.Bold);
var segment = new Segment("Foo Bar", style);
// When
- var (first, second) = segment.Split(3);
+ var result = segment.Split(3);
// Then
- first.Text.ShouldBe("Foo");
- first.Style.ShouldBe(style);
- second.Text.ShouldBe(" Bar");
- second.Style.ShouldBe(style);
+ return Verifier.Verify(result);
}
}
+ [UsesVerify]
public sealed class TheSplitLinesMethod
{
[Fact]
- public void Should_Split_Segment()
+ public Task Should_Split_Segment()
{
var context = new RenderContext(Encoding.UTF8, false);
@@ -70,10 +71,11 @@ namespace Spectre.Console.Tests.Unit
lines[2].Count.ShouldBe(1);
lines[2][0].Text.ShouldBe("Corgi");
+ return Verifier.Verify(lines);
}
[Fact]
- public void Should_Split_Segments_With_Linebreak_In_Text()
+ public Task Should_Split_Segments_With_Linebreak_In_Text()
{
var context = new RenderContext(Encoding.UTF8, false);
var lines = Segment.SplitLines(
@@ -88,20 +90,7 @@ namespace Spectre.Console.Tests.Unit
});
// Then
- lines.Count.ShouldBe(4);
-
- lines[0].Count.ShouldBe(1);
- lines[0][0].Text.ShouldBe("Foo");
-
- lines[1].Count.ShouldBe(1);
- lines[1][0].Text.ShouldBe("Bar");
-
- lines[2].Count.ShouldBe(2);
- lines[2][0].Text.ShouldBe("Baz");
- lines[2][1].Text.ShouldBe("Qux");
-
- lines[3].Count.ShouldBe(1);
- lines[3][0].Text.ShouldBe("Corgi");
+ return Verifier.Verify(lines);
}
}
}
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.Ascii2Border.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.Ascii2Border.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..8ecf0b0
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.Ascii2Border.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
++----------+----------+
+| Header 1 | Header 2 |
+|----------+----------|
+| Cell | Cell |
+| Cell | Cell |
+|----------+----------|
+| Footer 1 | Footer 2 |
++----------+----------+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.AsciiBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.AsciiBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..f8c4bac
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.AsciiBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
++---------------------+
+| Header 1 | Header 2 |
+|----------+----------|
+| Cell | Cell |
+| Cell | Cell |
+|----------+----------|
+| Footer 1 | Footer 2 |
++---------------------+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.AsciiDoubleHeadBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.AsciiDoubleHeadBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..4c681e4
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.AsciiDoubleHeadBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
++----------+----------+
+| Header 1 | Header 2 |
+|==========+==========|
+| Cell | Cell |
+| Cell | Cell |
++----------+----------+
+| Footer 1 | Footer 2 |
++----------+----------+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.DoubleBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.DoubleBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..89cee53
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.DoubleBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+╔══════════╦══════════╗
+║ Header 1 ║ Header 2 ║
+╠══════════╬══════════╣
+║ Cell ║ Cell ║
+║ Cell ║ Cell ║
+╠══════════╬══════════╣
+║ Footer 1 ║ Footer 2 ║
+╚══════════╩══════════╝
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.DoubleEdgeBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.DoubleEdgeBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..6d72748
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.DoubleEdgeBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+╔══════════╤══════════╗
+║ Header 1 │ Header 2 ║
+╟──────────┼──────────╢
+║ Cell │ Cell ║
+║ Cell │ Cell ║
+╟──────────┼──────────╢
+║ Footer 1 │ Footer 2 ║
+╚══════════╧══════════╝
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..7f71471
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+┏━━━━━━━━━━┳━━━━━━━━━━┓
+┃ Header 1 ┃ Header 2 ┃
+┣━━━━━━━━━━╋━━━━━━━━━━┫
+┃ Cell ┃ Cell ┃
+┃ Cell ┃ Cell ┃
+┣━━━━━━━━━━╋━━━━━━━━━━┫
+┃ Footer 1 ┃ Footer 2 ┃
+┗━━━━━━━━━━┻━━━━━━━━━━┛
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyEdgeBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyEdgeBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..380a850
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyEdgeBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+┏━━━━━━━━━━┯━━━━━━━━━━┓
+┃ Header 1 │ Header 2 ┃
+┠──────────┼──────────┨
+┃ Cell │ Cell ┃
+┃ Cell │ Cell ┃
+┠──────────┼──────────┨
+┃ Footer 1 │ Footer 2 ┃
+┗━━━━━━━━━━┷━━━━━━━━━━┛
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyHeadBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyHeadBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..52ed281
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.HeavyHeadBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+┏━━━━━━━━━━┳━━━━━━━━━━┓
+┃ Header 1 ┃ Header 2 ┃
+┡━━━━━━━━━━╇━━━━━━━━━━┩
+│ Cell │ Cell │
+│ Cell │ Cell │
+├──────────┼──────────┤
+│ Footer 1 │ Footer 2 │
+└──────────┴──────────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.HorizontalBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.HorizontalBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..7483d9e
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.HorizontalBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+───────────────────────
+ Header 1 Header 2
+───────────────────────
+ Cell Cell
+ Cell Cell
+───────────────────────
+ Footer 1 Footer 2
+───────────────────────
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..f76a93c
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,7 @@
+
+| Header 1 | Header 2 |
+| -------- | -------- |
+| Cell | Cell |
+| Cell | Cell |
+| Footer 1 | Footer 2 |
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Center_Aligned_Table_Columns_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Center_Aligned_Table_Columns_As_Expected.verified.txt
new file mode 100644
index 0000000..baf9537
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Center_Aligned_Table_Columns_As_Expected.verified.txt
@@ -0,0 +1,7 @@
+
+| Header 1 | Header 2 |
+| -------- | :------: |
+| Cell | Cell |
+| Cell | Cell |
+| Footer 1 | Footer 2 |
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Left_Aligned_Table_Columns_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Left_Aligned_Table_Columns_As_Expected.verified.txt
new file mode 100644
index 0000000..2cab4fe
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Left_Aligned_Table_Columns_As_Expected.verified.txt
@@ -0,0 +1,7 @@
+
+| Header 1 | Header 2 |
+| -------- | :------- |
+| Cell | Cell |
+| Cell | Cell |
+| Footer 1 | Footer 2 |
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Right_Aligned_Table_Columns_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Right_Aligned_Table_Columns_As_Expected.verified.txt
new file mode 100644
index 0000000..91856ab
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.MarkdownBorder.Should_Render_Right_Aligned_Table_Columns_As_Expected.verified.txt
@@ -0,0 +1,7 @@
+
+| Header 1 | Header 2 |
+| -------- | -------: |
+| Cell | Cell |
+| Cell | Cell |
+| Footer 1 | Footer 2 |
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..e4cd381
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+
+ Header 1 │ Header 2
+ ──────────┼──────────
+ Cell │ Cell
+ Cell │ Cell
+ ──────────┼──────────
+ Footer 1 │ Footer 2
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalDoubleHeadBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalDoubleHeadBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..0147030
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalDoubleHeadBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+
+ Header 1 │ Header 2
+ ══════════╪══════════
+ Cell │ Cell
+ Cell │ Cell
+ ══════════╪══════════
+ Footer 1 │ Footer 2
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalHeavyHeadBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalHeavyHeadBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..ef30305
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.MinimalHeavyHeadBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+
+ Header 1 │ Header 2
+ ━━━━━━━━━━┿━━━━━━━━━━
+ Cell │ Cell
+ Cell │ Cell
+ ━━━━━━━━━━┿━━━━━━━━━━
+ Footer 1 │ Footer 2
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.NoBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.NoBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..d4b908b
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.NoBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,4 @@
+Header 1 Header 2
+Cell Cell
+Cell Cell
+Footer 1 Footer 2
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.RoundedBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.RoundedBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..6d8b558
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.RoundedBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+╭──────────┬──────────╮
+│ Header 1 │ Header 2 │
+├──────────┼──────────┤
+│ Cell │ Cell │
+│ Cell │ Cell │
+├──────────┼──────────┤
+│ Footer 1 │ Footer 2 │
+╰──────────┴──────────╯
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.SimpleBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.SimpleBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..9958581
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.SimpleBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+
+ Header 1 Header 2
+───────────────────────
+ Cell Cell
+ Cell Cell
+───────────────────────
+ Footer 1 Footer 2
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.SimpleHeavyBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.SimpleHeavyBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..7822690
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.SimpleHeavyBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+
+ Header 1 Header 2
+━━━━━━━━━━━━━━━━━━━━━━━
+ Cell Cell
+ Cell Cell
+━━━━━━━━━━━━━━━━━━━━━━━
+ Footer 1 Footer 2
+
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.SquareBorder.Should_Render_As_Expected.verified.txt b/src/Spectre.Console.Tests/Unit/TableBorderTests.SquareBorder.Should_Render_As_Expected.verified.txt
new file mode 100644
index 0000000..248b07e
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.SquareBorder.Should_Render_As_Expected.verified.txt
@@ -0,0 +1,8 @@
+┌──────────┬──────────┐
+│ Header 1 │ Header 2 │
+├──────────┼──────────┤
+│ Cell │ Cell │
+│ Cell │ Cell │
+├──────────┼──────────┤
+│ Footer 1 │ Footer 2 │
+└──────────┴──────────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableBorderTests.cs b/src/Spectre.Console.Tests/Unit/TableBorderTests.cs
index 8b47969..9167067 100644
--- a/src/Spectre.Console.Tests/Unit/TableBorderTests.cs
+++ b/src/Spectre.Console.Tests/Unit/TableBorderTests.cs
@@ -1,11 +1,15 @@
+using System.Threading.Tasks;
using Shouldly;
using Spectre.Console.Rendering;
+using VerifyXunit;
using Xunit;
namespace Spectre.Console.Tests.Unit
{
+ [UsesVerify]
public sealed class TableBorderTests
{
+ [UsesVerify]
public sealed class NoBorder
{
[Fact]
@@ -32,7 +36,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -42,14 +46,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(4);
- console.Lines[0].ShouldBe("Header 1 Header 2");
- console.Lines[1].ShouldBe("Cell Cell ");
- console.Lines[2].ShouldBe("Cell Cell ");
- console.Lines[3].ShouldBe("Footer 1 Footer 2");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class AsciiBorder
{
[Fact]
@@ -76,7 +77,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -86,18 +87,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("+---------------------+");
- console.Lines[1].ShouldBe("| Header 1 | Header 2 |");
- console.Lines[2].ShouldBe("|----------+----------|");
- console.Lines[3].ShouldBe("| Cell | Cell |");
- console.Lines[4].ShouldBe("| Cell | Cell |");
- console.Lines[5].ShouldBe("|----------+----------|");
- console.Lines[6].ShouldBe("| Footer 1 | Footer 2 |");
- console.Lines[7].ShouldBe("+---------------------+");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class Ascii2Border
{
[Fact]
@@ -124,7 +118,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -134,18 +128,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("+----------+----------+");
- console.Lines[1].ShouldBe("| Header 1 | Header 2 |");
- console.Lines[2].ShouldBe("|----------+----------|");
- console.Lines[3].ShouldBe("| Cell | Cell |");
- console.Lines[4].ShouldBe("| Cell | Cell |");
- console.Lines[5].ShouldBe("|----------+----------|");
- console.Lines[6].ShouldBe("| Footer 1 | Footer 2 |");
- console.Lines[7].ShouldBe("+----------+----------+");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class AsciiDoubleHeadBorder
{
[Fact]
@@ -172,7 +159,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -182,18 +169,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("+----------+----------+");
- console.Lines[1].ShouldBe("| Header 1 | Header 2 |");
- console.Lines[2].ShouldBe("|==========+==========|");
- console.Lines[3].ShouldBe("| Cell | Cell |");
- console.Lines[4].ShouldBe("| Cell | Cell |");
- console.Lines[5].ShouldBe("+----------+----------+");
- console.Lines[6].ShouldBe("| Footer 1 | Footer 2 |");
- console.Lines[7].ShouldBe("+----------+----------+");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class SquareBorder
{
[Fact]
@@ -220,7 +200,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -230,18 +210,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("┌──────────┬──────────┐");
- console.Lines[1].ShouldBe("│ Header 1 │ Header 2 │");
- console.Lines[2].ShouldBe("├──────────┼──────────┤");
- console.Lines[3].ShouldBe("│ Cell │ Cell │");
- console.Lines[4].ShouldBe("│ Cell │ Cell │");
- console.Lines[5].ShouldBe("├──────────┼──────────┤");
- console.Lines[6].ShouldBe("│ Footer 1 │ Footer 2 │");
- console.Lines[7].ShouldBe("└──────────┴──────────┘");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class RoundedBorder
{
[Fact]
@@ -268,7 +241,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -278,18 +251,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("╭──────────┬──────────╮");
- console.Lines[1].ShouldBe("│ Header 1 │ Header 2 │");
- console.Lines[2].ShouldBe("├──────────┼──────────┤");
- console.Lines[3].ShouldBe("│ Cell │ Cell │");
- console.Lines[4].ShouldBe("│ Cell │ Cell │");
- console.Lines[5].ShouldBe("├──────────┼──────────┤");
- console.Lines[6].ShouldBe("│ Footer 1 │ Footer 2 │");
- console.Lines[7].ShouldBe("╰──────────┴──────────╯");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class MinimalBorder
{
[Fact]
@@ -316,7 +282,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -326,18 +292,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe(" Header 1 │ Header 2 ");
- console.Lines[2].ShouldBe(" ──────────┼────────── ");
- console.Lines[3].ShouldBe(" Cell │ Cell ");
- console.Lines[4].ShouldBe(" Cell │ Cell ");
- console.Lines[5].ShouldBe(" ──────────┼────────── ");
- console.Lines[6].ShouldBe(" Footer 1 │ Footer 2 ");
- console.Lines[7].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class MinimalHeavyHeadBorder
{
[Fact]
@@ -364,7 +323,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -374,18 +333,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe(" Header 1 │ Header 2 ");
- console.Lines[2].ShouldBe(" ━━━━━━━━━━┿━━━━━━━━━━ ");
- console.Lines[3].ShouldBe(" Cell │ Cell ");
- console.Lines[4].ShouldBe(" Cell │ Cell ");
- console.Lines[5].ShouldBe(" ━━━━━━━━━━┿━━━━━━━━━━ ");
- console.Lines[6].ShouldBe(" Footer 1 │ Footer 2 ");
- console.Lines[7].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class MinimalDoubleHeadBorder
{
[Fact]
@@ -412,7 +364,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -422,18 +374,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe(" Header 1 │ Header 2 ");
- console.Lines[2].ShouldBe(" ══════════╪══════════ ");
- console.Lines[3].ShouldBe(" Cell │ Cell ");
- console.Lines[4].ShouldBe(" Cell │ Cell ");
- console.Lines[5].ShouldBe(" ══════════╪══════════ ");
- console.Lines[6].ShouldBe(" Footer 1 │ Footer 2 ");
- console.Lines[7].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class SimpleBorder
{
[Fact]
@@ -460,7 +405,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -470,18 +415,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe(" Header 1 Header 2 ");
- console.Lines[2].ShouldBe("───────────────────────");
- console.Lines[3].ShouldBe(" Cell Cell ");
- console.Lines[4].ShouldBe(" Cell Cell ");
- console.Lines[5].ShouldBe("───────────────────────");
- console.Lines[6].ShouldBe(" Footer 1 Footer 2 ");
- console.Lines[7].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class HorizontalBorder
{
[Fact]
@@ -508,7 +446,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -518,18 +456,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("───────────────────────");
- console.Lines[1].ShouldBe(" Header 1 Header 2 ");
- console.Lines[2].ShouldBe("───────────────────────");
- console.Lines[3].ShouldBe(" Cell Cell ");
- console.Lines[4].ShouldBe(" Cell Cell ");
- console.Lines[5].ShouldBe("───────────────────────");
- console.Lines[6].ShouldBe(" Footer 1 Footer 2 ");
- console.Lines[7].ShouldBe("───────────────────────");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class SimpleHeavyBorder
{
[Fact]
@@ -556,7 +487,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -566,18 +497,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe(" Header 1 Header 2 ");
- console.Lines[2].ShouldBe("━━━━━━━━━━━━━━━━━━━━━━━");
- console.Lines[3].ShouldBe(" Cell Cell ");
- console.Lines[4].ShouldBe(" Cell Cell ");
- console.Lines[5].ShouldBe("━━━━━━━━━━━━━━━━━━━━━━━");
- console.Lines[6].ShouldBe(" Footer 1 Footer 2 ");
- console.Lines[7].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class HeavyBorder
{
[Fact]
@@ -604,7 +528,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -614,18 +538,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("┏━━━━━━━━━━┳━━━━━━━━━━┓");
- console.Lines[1].ShouldBe("┃ Header 1 ┃ Header 2 ┃");
- console.Lines[2].ShouldBe("┣━━━━━━━━━━╋━━━━━━━━━━┫");
- console.Lines[3].ShouldBe("┃ Cell ┃ Cell ┃");
- console.Lines[4].ShouldBe("┃ Cell ┃ Cell ┃");
- console.Lines[5].ShouldBe("┣━━━━━━━━━━╋━━━━━━━━━━┫");
- console.Lines[6].ShouldBe("┃ Footer 1 ┃ Footer 2 ┃");
- console.Lines[7].ShouldBe("┗━━━━━━━━━━┻━━━━━━━━━━┛");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class HeavyEdgeBorder
{
[Fact]
@@ -652,7 +569,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -662,18 +579,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("┏━━━━━━━━━━┯━━━━━━━━━━┓");
- console.Lines[1].ShouldBe("┃ Header 1 │ Header 2 ┃");
- console.Lines[2].ShouldBe("┠──────────┼──────────┨");
- console.Lines[3].ShouldBe("┃ Cell │ Cell ┃");
- console.Lines[4].ShouldBe("┃ Cell │ Cell ┃");
- console.Lines[5].ShouldBe("┠──────────┼──────────┨");
- console.Lines[6].ShouldBe("┃ Footer 1 │ Footer 2 ┃");
- console.Lines[7].ShouldBe("┗━━━━━━━━━━┷━━━━━━━━━━┛");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class HeavyHeadBorder
{
[Fact]
@@ -700,7 +610,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -710,18 +620,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("┏━━━━━━━━━━┳━━━━━━━━━━┓");
- console.Lines[1].ShouldBe("┃ Header 1 ┃ Header 2 ┃");
- console.Lines[2].ShouldBe("┡━━━━━━━━━━╇━━━━━━━━━━┩");
- console.Lines[3].ShouldBe("│ Cell │ Cell │");
- console.Lines[4].ShouldBe("│ Cell │ Cell │");
- console.Lines[5].ShouldBe("├──────────┼──────────┤");
- console.Lines[6].ShouldBe("│ Footer 1 │ Footer 2 │");
- console.Lines[7].ShouldBe("└──────────┴──────────┘");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class DoubleBorder
{
[Fact]
@@ -748,7 +651,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -758,18 +661,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("╔══════════╦══════════╗");
- console.Lines[1].ShouldBe("║ Header 1 ║ Header 2 ║");
- console.Lines[2].ShouldBe("╠══════════╬══════════╣");
- console.Lines[3].ShouldBe("║ Cell ║ Cell ║");
- console.Lines[4].ShouldBe("║ Cell ║ Cell ║");
- console.Lines[5].ShouldBe("╠══════════╬══════════╣");
- console.Lines[6].ShouldBe("║ Footer 1 ║ Footer 2 ║");
- console.Lines[7].ShouldBe("╚══════════╩══════════╝");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class DoubleEdgeBorder
{
[Fact]
@@ -796,7 +692,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -806,18 +702,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("╔══════════╤══════════╗");
- console.Lines[1].ShouldBe("║ Header 1 │ Header 2 ║");
- console.Lines[2].ShouldBe("╟──────────┼──────────╢");
- console.Lines[3].ShouldBe("║ Cell │ Cell ║");
- console.Lines[4].ShouldBe("║ Cell │ Cell ║");
- console.Lines[5].ShouldBe("╟──────────┼──────────╢");
- console.Lines[6].ShouldBe("║ Footer 1 │ Footer 2 ║");
- console.Lines[7].ShouldBe("╚══════════╧══════════╝");
+ return Verifier.Verify(console.Output);
}
}
+ [UsesVerify]
public sealed class MarkdownBorder
{
[Fact]
@@ -844,7 +733,7 @@ namespace Spectre.Console.Tests.Unit
}
[Fact]
- public void Should_Render_As_Expected()
+ public Task Should_Render_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -854,18 +743,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe("| Header 1 | Header 2 |");
- console.Lines[2].ShouldBe("| -------- | -------- |");
- console.Lines[3].ShouldBe("| Cell | Cell |");
- console.Lines[4].ShouldBe("| Cell | Cell |");
- console.Lines[5].ShouldBe("| Footer 1 | Footer 2 |");
- console.Lines[6].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Left_Aligned_Table_Columns_As_Expected()
+ public Task Should_Render_Left_Aligned_Table_Columns_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -875,18 +757,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe("| Header 1 | Header 2 |");
- console.Lines[2].ShouldBe("| -------- | :------- |");
- console.Lines[3].ShouldBe("| Cell | Cell |");
- console.Lines[4].ShouldBe("| Cell | Cell |");
- console.Lines[5].ShouldBe("| Footer 1 | Footer 2 |");
- console.Lines[6].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Center_Aligned_Table_Columns_As_Expected()
+ public Task Should_Render_Center_Aligned_Table_Columns_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -896,18 +771,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe("| Header 1 | Header 2 |");
- console.Lines[2].ShouldBe("| -------- | :------: |");
- console.Lines[3].ShouldBe("| Cell | Cell |");
- console.Lines[4].ShouldBe("| Cell | Cell |");
- console.Lines[5].ShouldBe("| Footer 1 | Footer 2 |");
- console.Lines[6].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Right_Aligned_Table_Columns_As_Expected()
+ public Task Should_Render_Right_Aligned_Table_Columns_As_Expected()
{
// Given
var console = new PlainConsole();
@@ -917,14 +785,7 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe(" ");
- console.Lines[1].ShouldBe("| Header 1 | Header 2 |");
- console.Lines[2].ShouldBe("| -------- | -------: |");
- console.Lines[3].ShouldBe("| Cell | Cell |");
- console.Lines[4].ShouldBe("| Cell | Cell |");
- console.Lines[5].ShouldBe("| Footer 1 | Footer 2 |");
- console.Lines[6].ShouldBe(" ");
+ return Verifier.Verify(console.Output);
}
}
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Center_Table_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Center_Table_Correctly.verified.txt
new file mode 100644
index 0000000..c850090
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Center_Table_Correctly.verified.txt
@@ -0,0 +1,6 @@
+ ┌────────┬────────┬───────┐
+ │ Foo │ Bar │ Baz │
+ ├────────┼────────┼───────┤
+ │ Qux │ Corgi │ Waldo │
+ │ Grault │ Garply │ Fred │
+ └────────┴────────┴───────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Center_Table_With_Title_And_Caption_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Center_Table_With_Title_And_Caption_Correctly.verified.txt
new file mode 100644
index 0000000..5a6313c
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Center_Table_With_Title_And_Caption_Correctly.verified.txt
@@ -0,0 +1,8 @@
+ Hello World
+ ╭────────┬────────┬───────╮
+ │ Foo │ Bar │ Baz │
+ ├────────┼────────┼───────┤
+ │ Qux │ Corgi │ Waldo │
+ │ Grault │ Garply │ Fred │
+ ╰────────┴────────┴───────╯
+ Goodbye World
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Expand_Table_To_Available_Space_If_Specified.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Expand_Table_To_Available_Space_If_Specified.verified.txt
new file mode 100644
index 0000000..ca5fccd
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Expand_Table_To_Available_Space_If_Specified.verified.txt
@@ -0,0 +1,6 @@
+┌───────────────────────────┬───────────────────────────┬──────────────────────┐
+│ Foo │ Bar │ Baz │
+├───────────────────────────┼───────────────────────────┼──────────────────────┤
+│ Qux │ Corgi │ Waldo │
+│ Grault │ Garply │ Fred │
+└───────────────────────────┴───────────────────────────┴──────────────────────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Left_Align_Table_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Left_Align_Table_Correctly.verified.txt
new file mode 100644
index 0000000..5f13934
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Left_Align_Table_Correctly.verified.txt
@@ -0,0 +1,6 @@
+┌────────┬────────┬───────┐
+│ Foo │ Bar │ Baz │
+├────────┼────────┼───────┤
+│ Qux │ Corgi │ Waldo │
+│ Grault │ Garply │ Fred │
+└────────┴────────┴───────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Left_Align_Table_With_Title_And_Caption_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Left_Align_Table_With_Title_And_Caption_Correctly.verified.txt
new file mode 100644
index 0000000..82feb06
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Left_Align_Table_With_Title_And_Caption_Correctly.verified.txt
@@ -0,0 +1,8 @@
+ Hello World
+╭────────┬────────┬───────╮
+│ Foo │ Bar │ Baz │
+├────────┼────────┼───────┤
+│ Qux │ Corgi │ Waldo │
+│ Grault │ Garply │ Fred │
+╰────────┴────────┴───────╯
+ Goodbye World
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Not_Draw_Tables_That_Are_Impossible_To_Draw.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Not_Draw_Tables_That_Are_Impossible_To_Draw.verified.txt
new file mode 100644
index 0000000..379a628
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Not_Draw_Tables_That_Are_Impossible_To_Draw.verified.txt
@@ -0,0 +1,12 @@
+╭───────┬───────┬───────╮
+│ ┌───┐ │ ┌───┐ │ ┌───┐ │
+│ │ A │ │ │ D │ │ │ G │ │
+│ │ B │ │ │ E │ │ │ H │ │
+│ │ C │ │ │ F │ │ │ I │ │
+│ └───┘ │ └───┘ │ └───┘ │
+├───────┼───────┼───────┤
+│ Hello │ World │ │
+│ … │ Whaat │ Lol │
+│ Hej │ Värld │ │
+│ │ en │ │
+╰───────┴───────┴───────╯
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Correctly.verified.txt
new file mode 100644
index 0000000..5f13934
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Correctly.verified.txt
@@ -0,0 +1,6 @@
+┌────────┬────────┬───────┐
+│ Foo │ Bar │ Baz │
+├────────┼────────┼───────┤
+│ Qux │ Corgi │ Waldo │
+│ Grault │ Garply │ Fred │
+└────────┴────────┴───────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Nested_In_Panels_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Nested_In_Panels_Correctly.verified.txt
new file mode 100644
index 0000000..a527173
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Nested_In_Panels_Correctly.verified.txt
@@ -0,0 +1,11 @@
+┌───────────────────────────────────┐
+│ +-------------------------------+ │
+│ | ╭──────────┬────────┬───────╮ | │
+│ | │ Foo │ Bar │ Baz │ | │
+│ | ├──────────┼────────┼───────┤ | │
+│ | │ Qux │ Corgi │ Waldo │ | │
+│ | │ Quuuuuux │ │ │ | │
+│ | │ Grault │ Garply │ Fred │ | │
+│ | ╰──────────┴────────┴───────╯ | │
+│ +-------------------------------+ │
+└───────────────────────────────────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Cell_Padding_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Cell_Padding_Correctly.verified.txt
new file mode 100644
index 0000000..6eacc84
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Cell_Padding_Correctly.verified.txt
@@ -0,0 +1,7 @@
+┌────────┬────────┬──────────┐
+│ Foo │ Bar │ Baz │
+├────────┼────────┼──────────┤
+│ Qux │ Corgi │ Waldo │
+│ Quuux │ │ │
+│ Grault │ Garply │ Fred │
+└────────┴────────┴──────────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Column_Justification_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Column_Justification_Correctly.verified.txt
new file mode 100644
index 0000000..6776044
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Column_Justification_Correctly.verified.txt
@@ -0,0 +1,6 @@
+┌────────┬────────┬────────────────────────────┐
+│ Foo │ Bar │ Baz │
+├────────┼────────┼────────────────────────────┤
+│ Qux │ Corgi │ Waldo │
+│ Grault │ Garply │ Lorem ipsum dolor sit amet │
+└────────┴────────┴────────────────────────────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Footers_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Footers_Correctly.verified.txt
new file mode 100644
index 0000000..244b1b7
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Footers_Correctly.verified.txt
@@ -0,0 +1,8 @@
+┌────────┬────────┬───────┐
+│ Foo │ Bar │ Baz │
+├────────┼────────┼───────┤
+│ Qux │ Corgi │ Waldo │
+│ Grault │ Garply │ Fred │
+├────────┼────────┼───────┤
+│ Oof │ │ Zab │
+└────────┴────────┴───────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Multiple_Rows_In_Cell_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Multiple_Rows_In_Cell_Correctly.verified.txt
new file mode 100644
index 0000000..5114854
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Multiple_Rows_In_Cell_Correctly.verified.txt
@@ -0,0 +1,7 @@
+┌────────┬────────┬───────┐
+│ Foo │ Bar │ Baz │
+├────────┼────────┼───────┤
+│ Qux │ Corgi │ Waldo │
+│ Quuux │ │ │
+│ Grault │ Garply │ Fred │
+└────────┴────────┴───────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_No_Border_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_No_Border_Correctly.verified.txt
new file mode 100644
index 0000000..2ce9e29
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_No_Border_Correctly.verified.txt
@@ -0,0 +1,3 @@
+Foo Bar Baz
+Qux Corgi Waldo
+Grault Garply Fred
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Title_And_Caption_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Title_And_Caption_Correctly.verified.txt
new file mode 100644
index 0000000..82feb06
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_With_Title_And_Caption_Correctly.verified.txt
@@ -0,0 +1,8 @@
+ Hello World
+╭────────┬────────┬───────╮
+│ Foo │ Bar │ Baz │
+├────────┼────────┼───────┤
+│ Qux │ Corgi │ Waldo │
+│ Grault │ Garply │ Fred │
+╰────────┴────────┴───────╯
+ Goodbye World
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Without_Rows.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Without_Rows.verified.txt
new file mode 100644
index 0000000..8b32b8d
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Render_Table_Without_Rows.verified.txt
@@ -0,0 +1,3 @@
+┌─────┬─────┬────────┐
+│ Foo │ Bar │ Baz │
+└─────┴─────┴────────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Right_Align_Table_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Right_Align_Table_Correctly.verified.txt
new file mode 100644
index 0000000..3b73d52
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Right_Align_Table_Correctly.verified.txt
@@ -0,0 +1,6 @@
+ ┌────────┬────────┬───────┐
+ │ Foo │ Bar │ Baz │
+ ├────────┼────────┼───────┤
+ │ Qux │ Corgi │ Waldo │
+ │ Grault │ Garply │ Fred │
+ └────────┴────────┴───────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.Should_Right_Align_Table_With_Title_And_Caption_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.Should_Right_Align_Table_With_Title_And_Caption_Correctly.verified.txt
new file mode 100644
index 0000000..d11f171
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.Should_Right_Align_Table_With_Title_And_Caption_Correctly.verified.txt
@@ -0,0 +1,8 @@
+ Hello World
+ ╭────────┬────────┬───────╮
+ │ Foo │ Bar │ Baz │
+ ├────────┼────────┼───────┤
+ │ Qux │ Corgi │ Waldo │
+ │ Grault │ Garply │ Fred │
+ ╰────────┴────────┴───────╯
+ Goodbye World
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.TheAddEmptyRowMethod.Should_Render_Table_Correctly.verified.txt b/src/Spectre.Console.Tests/Unit/TableTests.TheAddEmptyRowMethod.Should_Render_Table_Correctly.verified.txt
new file mode 100644
index 0000000..cbde18e
--- /dev/null
+++ b/src/Spectre.Console.Tests/Unit/TableTests.TheAddEmptyRowMethod.Should_Render_Table_Correctly.verified.txt
@@ -0,0 +1,7 @@
+┌────────┬────────┬───────┐
+│ Foo │ Bar │ Baz │
+├────────┼────────┼───────┤
+│ Qux │ Corgi │ Waldo │
+│ │ │ │
+│ Grault │ Garply │ Fred │
+└────────┴────────┴───────┘
diff --git a/src/Spectre.Console.Tests/Unit/TableTests.cs b/src/Spectre.Console.Tests/Unit/TableTests.cs
index 384ba8f..69f372f 100644
--- a/src/Spectre.Console.Tests/Unit/TableTests.cs
+++ b/src/Spectre.Console.Tests/Unit/TableTests.cs
@@ -1,9 +1,12 @@
using System;
+using System.Threading.Tasks;
using Shouldly;
+using VerifyXunit;
using Xunit;
namespace Spectre.Console.Tests.Unit
{
+ [UsesVerify]
public sealed class TableTests
{
public sealed class TheAddColumnMethod
@@ -117,10 +120,11 @@ namespace Spectre.Console.Tests.Unit
}
}
+ [UsesVerify]
public sealed class TheAddEmptyRowMethod
{
[Fact]
- public void Should_Render_Table_Correctly()
+ public Task Should_Render_Table_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -134,19 +138,12 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe("┌────────┬────────┬───────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ │ │ │");
- console.Lines[5].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[6].ShouldBe("└────────┴────────┴───────┘");
+ return Verifier.Verify(console.Output);
}
}
[Fact]
- public void Should_Render_Table_Correctly()
+ public Task Should_Render_Table_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -159,17 +156,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(6);
- console.Lines[0].ShouldBe("┌────────┬────────┬───────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[5].ShouldBe("└────────┴────────┴───────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_With_Footers_Correctly()
+ public Task Should_Render_Table_With_Footers_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -184,19 +175,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe("┌────────┬────────┬───────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[5].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[6].ShouldBe("│ Oof │ │ Zab │");
- console.Lines[7].ShouldBe("└────────┴────────┴───────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Left_Align_Table_Correctly()
+ public Task Should_Left_Align_Table_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -210,17 +193,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(6);
- console.Lines[0].ShouldBe("┌────────┬────────┬───────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[5].ShouldBe("└────────┴────────┴───────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Center_Table_Correctly()
+ public Task Should_Center_Table_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -234,17 +211,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(6);
- console.Lines[0].ShouldBe(" ┌────────┬────────┬───────┐ ");
- console.Lines[1].ShouldBe(" │ Foo │ Bar │ Baz │ ");
- console.Lines[2].ShouldBe(" ├────────┼────────┼───────┤ ");
- console.Lines[3].ShouldBe(" │ Qux │ Corgi │ Waldo │ ");
- console.Lines[4].ShouldBe(" │ Grault │ Garply │ Fred │ ");
- console.Lines[5].ShouldBe(" └────────┴────────┴───────┘ ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Right_Align_Table_Correctly()
+ public Task Should_Right_Align_Table_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -258,17 +229,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(6);
- console.Lines[0].ShouldBe(" ┌────────┬────────┬───────┐");
- console.Lines[1].ShouldBe(" │ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe(" ├────────┼────────┼───────┤");
- console.Lines[3].ShouldBe(" │ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe(" │ Grault │ Garply │ Fred │");
- console.Lines[5].ShouldBe(" └────────┴────────┴───────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_Nested_In_Panels_Correctly()
+ public Task Should_Render_Table_Nested_In_Panels_Correctly()
{
// A simple table
var console = new PlainConsole(width: 80);
@@ -286,22 +251,11 @@ namespace Spectre.Console.Tests.Unit
}));
// Then
- console.Lines.Count.ShouldBe(11);
- console.Lines[00].ShouldBe("┌───────────────────────────────────┐");
- console.Lines[01].ShouldBe("│ +-------------------------------+ │");
- console.Lines[02].ShouldBe("│ | ╭──────────┬────────┬───────╮ | │");
- console.Lines[03].ShouldBe("│ | │ Foo │ Bar │ Baz │ | │");
- console.Lines[04].ShouldBe("│ | ├──────────┼────────┼───────┤ | │");
- console.Lines[05].ShouldBe("│ | │ Qux │ Corgi │ Waldo │ | │");
- console.Lines[06].ShouldBe("│ | │ Quuuuuux │ │ │ | │");
- console.Lines[07].ShouldBe("│ | │ Grault │ Garply │ Fred │ | │");
- console.Lines[08].ShouldBe("│ | ╰──────────┴────────┴───────╯ | │");
- console.Lines[09].ShouldBe("│ +-------------------------------+ │");
- console.Lines[10].ShouldBe("└───────────────────────────────────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_With_Column_Justification_Correctly()
+ public Task Should_Render_Table_With_Column_Justification_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -316,17 +270,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(6);
- console.Lines[0].ShouldBe("┌────────┬────────┬────────────────────────────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├────────┼────────┼────────────────────────────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ Grault │ Garply │ Lorem ipsum dolor sit amet │");
- console.Lines[5].ShouldBe("└────────┴────────┴────────────────────────────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Expand_Table_To_Available_Space_If_Specified()
+ public Task Should_Expand_Table_To_Available_Space_If_Specified()
{
// Given
var console = new PlainConsole(width: 80);
@@ -339,18 +287,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(6);
- console.Lines[0].Length.ShouldBe(80);
- console.Lines[0].ShouldBe("┌───────────────────────────┬───────────────────────────┬──────────────────────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├───────────────────────────┼───────────────────────────┼──────────────────────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[5].ShouldBe("└───────────────────────────┴───────────────────────────┴──────────────────────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_With_No_Border_Correctly()
+ public Task Should_Render_Table_With_No_Border_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -363,14 +304,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(3);
- console.Lines[0].ShouldBe("Foo Bar Baz ");
- console.Lines[1].ShouldBe("Qux Corgi Waldo");
- console.Lines[2].ShouldBe("Grault Garply Fred ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_With_Multiple_Rows_In_Cell_Correctly()
+ public Task Should_Render_Table_With_Multiple_Rows_In_Cell_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -383,18 +321,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe("┌────────┬────────┬───────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ Quuux │ │ │");
- console.Lines[5].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[6].ShouldBe("└────────┴────────┴───────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_With_Cell_Padding_Correctly()
+ public Task Should_Render_Table_With_Cell_Padding_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -408,18 +339,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(7);
- console.Lines[0].ShouldBe("┌────────┬────────┬──────────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("├────────┼────────┼──────────┤");
- console.Lines[3].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[4].ShouldBe("│ Quuux │ │ │");
- console.Lines[5].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[6].ShouldBe("└────────┴────────┴──────────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_Without_Footer_If_No_Rows_Are_Added()
+ public Task Should_Render_Table_Without_Rows()
{
// Given
var console = new PlainConsole(width: 80);
@@ -431,14 +355,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(3);
- console.Lines[0].ShouldBe("┌─────┬─────┬────────┐");
- console.Lines[1].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[2].ShouldBe("└─────┴─────┴────────┘");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Not_Draw_Tables_That_Are_Impossible_To_Draw()
+ public Task Should_Not_Draw_Tables_That_Are_Impossible_To_Draw()
{
// Given
var console = new PlainConsole(width: 25);
@@ -471,23 +392,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(12);
- console.Lines[00].ShouldBe("╭───────┬───────┬───────╮");
- console.Lines[01].ShouldBe("│ ┌───┐ │ ┌───┐ │ ┌───┐ │");
- console.Lines[02].ShouldBe("│ │ A │ │ │ D │ │ │ G │ │");
- console.Lines[03].ShouldBe("│ │ B │ │ │ E │ │ │ H │ │");
- console.Lines[04].ShouldBe("│ │ C │ │ │ F │ │ │ I │ │");
- console.Lines[05].ShouldBe("│ └───┘ │ └───┘ │ └───┘ │");
- console.Lines[06].ShouldBe("├───────┼───────┼───────┤");
- console.Lines[07].ShouldBe("│ Hello │ World │ │");
- console.Lines[08].ShouldBe("│ … │ Whaat │ Lol │");
- console.Lines[09].ShouldBe("│ Hej │ Värld │ │");
- console.Lines[10].ShouldBe("│ │ en │ │");
- console.Lines[11].ShouldBe("╰───────┴───────┴───────╯");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Render_Table_With_Title_And_Caption_Correctly()
+ public Task Should_Render_Table_With_Title_And_Caption_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -502,19 +411,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" Hello World ");
- console.Lines[1].ShouldBe("╭────────┬────────┬───────╮");
- console.Lines[2].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[3].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[4].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[5].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[6].ShouldBe("╰────────┴────────┴───────╯");
- console.Lines[7].ShouldBe(" Goodbye World ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Left_Align_Table_With_Title_And_Caption_Correctly()
+ public Task Should_Left_Align_Table_With_Title_And_Caption_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -530,19 +431,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" Hello World ");
- console.Lines[1].ShouldBe("╭────────┬────────┬───────╮");
- console.Lines[2].ShouldBe("│ Foo │ Bar │ Baz │");
- console.Lines[3].ShouldBe("├────────┼────────┼───────┤");
- console.Lines[4].ShouldBe("│ Qux │ Corgi │ Waldo │");
- console.Lines[5].ShouldBe("│ Grault │ Garply │ Fred │");
- console.Lines[6].ShouldBe("╰────────┴────────┴───────╯");
- console.Lines[7].ShouldBe(" Goodbye World ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Center_Table_With_Title_And_Caption_Correctly()
+ public Task Should_Center_Table_With_Title_And_Caption_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -558,19 +451,11 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" Hello World ");
- console.Lines[1].ShouldBe(" ╭────────┬────────┬───────╮ ");
- console.Lines[2].ShouldBe(" │ Foo │ Bar │ Baz │ ");
- console.Lines[3].ShouldBe(" ├────────┼────────┼───────┤ ");
- console.Lines[4].ShouldBe(" │ Qux │ Corgi │ Waldo │ ");
- console.Lines[5].ShouldBe(" │ Grault │ Garply │ Fred │ ");
- console.Lines[6].ShouldBe(" ╰────────┴────────┴───────╯ ");
- console.Lines[7].ShouldBe(" Goodbye World ");
+ return Verifier.Verify(console.Output);
}
[Fact]
- public void Should_Right_Align_Table_With_Title_And_Caption_Correctly()
+ public Task Should_Right_Align_Table_With_Title_And_Caption_Correctly()
{
// Given
var console = new PlainConsole(width: 80);
@@ -586,15 +471,7 @@ namespace Spectre.Console.Tests.Unit
console.Render(table);
// Then
- console.Lines.Count.ShouldBe(8);
- console.Lines[0].ShouldBe(" Hello World ");
- console.Lines[1].ShouldBe(" ╭────────┬────────┬───────╮");
- console.Lines[2].ShouldBe(" │ Foo │ Bar │ Baz │");
- console.Lines[3].ShouldBe(" ├────────┼────────┼───────┤");
- console.Lines[4].ShouldBe(" │ Qux │ Corgi │ Waldo │");
- console.Lines[5].ShouldBe(" │ Grault │ Garply │ Fred │");
- console.Lines[6].ShouldBe(" ╰────────┴────────┴───────╯");
- console.Lines[7].ShouldBe(" Goodbye World ");
+ return Verifier.Verify(console.Output);
}
}
}
diff --git a/src/Spectre.Console.Tests/Unit/TextTests.cs b/src/Spectre.Console.Tests/Unit/TextTests.cs
index 2787884..ad0184c 100644
--- a/src/Spectre.Console.Tests/Unit/TextTests.cs
+++ b/src/Spectre.Console.Tests/Unit/TextTests.cs
@@ -44,9 +44,7 @@ namespace Spectre.Console.Tests.Unit
console.Render(text);
// Then
- console.Output
- .NormalizeLineEndings()
- .ShouldBe("Hello World");
+ console.Output.ShouldBe("Hello World");
}
[Theory]
@@ -62,7 +60,7 @@ namespace Spectre.Console.Tests.Unit
console.Render(text);
// Then
- console.RawOutput.ShouldBe("Hello\n\nWorld\n\n");
+ console.Output.ShouldBe("Hello\n\nWorld\n\n");
}
[Fact]
diff --git a/src/Spectre.Console/Rendering/Segment.cs b/src/Spectre.Console/Rendering/Segment.cs
index 45b2277..0c3073e 100644
--- a/src/Spectre.Console/Rendering/Segment.cs
+++ b/src/Spectre.Console/Rendering/Segment.cs
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
-using Spectre.Console.Internal;
namespace Spectre.Console.Rendering
{
diff --git a/src/Spectre.Console/Widgets/Panel.cs b/src/Spectre.Console/Widgets/Panel.cs
index 483d1b6..da550fa 100644
--- a/src/Spectre.Console/Widgets/Panel.cs
+++ b/src/Spectre.Console/Widgets/Panel.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Spectre.Console.Internal;
using Spectre.Console.Rendering;
namespace Spectre.Console
diff --git a/src/Spectre.Console/Widgets/Rule.cs b/src/Spectre.Console/Widgets/Rule.cs
index dafe8e9..c3b9c2f 100644
--- a/src/Spectre.Console/Widgets/Rule.cs
+++ b/src/Spectre.Console/Widgets/Rule.cs
@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Spectre.Console.Internal;
using Spectre.Console.Rendering;
namespace Spectre.Console