mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-16 00:42:51 +08:00

* Add support for C# 12 * Run all tests on all major .NET SDKs * Only build on Ubuntu * Do not build docs for pull requests * Add Cédric Luthi, and Frank Ray to authors * Drop netstandard2.0 for ImageSharp plugin
23 lines
583 B
C#
23 lines
583 B
C#
namespace Spectre.Console.Tests.Unit;
|
|
|
|
[ExpectationPath("Widgets/Json")]
|
|
public sealed class JsonTextTests
|
|
{
|
|
[Fact]
|
|
[Expectation("Render_Json")]
|
|
public Task Should_Render_Json()
|
|
{
|
|
// Given
|
|
var console = new TestConsole().Size(new Size(80, 15));
|
|
var json = EmbeddedResourceReader
|
|
.LoadResourceStream("Spectre.Console.Tests/Data/example.json")
|
|
.ReadText();
|
|
|
|
// When
|
|
console.Write(new Panel(new JsonText(json)).Header("Some JSON"));
|
|
|
|
// Then
|
|
return Verifier.Verify(console.Output);
|
|
}
|
|
}
|