mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-06-19 05:18:16 +08:00
Add global usings (#668)
* Use global usings * Fix namespace declarations for test projects
This commit is contained in:
@ -1,30 +1,24 @@
|
||||
using System;
|
||||
using Shouldly;
|
||||
using Spectre.Console.Testing;
|
||||
using Xunit;
|
||||
namespace Spectre.Console.Tests.Unit;
|
||||
|
||||
namespace Spectre.Console.Tests.Unit
|
||||
public sealed class SelectionPromptTests
|
||||
{
|
||||
public sealed class SelectionPromptTests
|
||||
[Fact]
|
||||
[GitHubIssue(608)]
|
||||
public void Should_Not_Throw_When_Selecting_An_Item_With_Escaped_Markup()
|
||||
{
|
||||
[Fact]
|
||||
[GitHubIssue(608)]
|
||||
public void Should_Not_Throw_When_Selecting_An_Item_With_Escaped_Markup()
|
||||
{
|
||||
// Given
|
||||
var console = new TestConsole();
|
||||
console.Profile.Capabilities.Interactive = true;
|
||||
console.Input.PushKey(ConsoleKey.Enter);
|
||||
var input = "[red]This text will never be red[/]".EscapeMarkup();
|
||||
// Given
|
||||
var console = new TestConsole();
|
||||
console.Profile.Capabilities.Interactive = true;
|
||||
console.Input.PushKey(ConsoleKey.Enter);
|
||||
var input = "[red]This text will never be red[/]".EscapeMarkup();
|
||||
|
||||
// When
|
||||
var prompt = new SelectionPrompt<string>()
|
||||
.Title("Select one")
|
||||
.AddChoices(input);
|
||||
prompt.Show(console);
|
||||
// When
|
||||
var prompt = new SelectionPrompt<string>()
|
||||
.Title("Select one")
|
||||
.AddChoices(input);
|
||||
prompt.Show(console);
|
||||
|
||||
// Then
|
||||
console.Output.ShouldContain(@"[red]This text will never be red[/]");
|
||||
}
|
||||
// Then
|
||||
console.Output.ShouldContain(@"[red]This text will never be red[/]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user