mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-06 20:48:15 +08:00
Add fallback for unicode borders
This commit is contained in:
@ -10,13 +10,18 @@ namespace Spectre.Console.Tests.Unit.Composition
|
||||
public sealed class TheGetBorderMethod
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(BorderKind.Ascii, typeof(AsciiBorder))]
|
||||
[InlineData(BorderKind.Square, typeof(SquareBorder))]
|
||||
[InlineData(BorderKind.Rounded, typeof(RoundedBorder))]
|
||||
public void Should_Return_Correct_Border_For_Specified_Kind(BorderKind kind, Type expected)
|
||||
[InlineData(BorderKind.None, false, typeof(NoBorder))]
|
||||
[InlineData(BorderKind.Ascii, false, typeof(AsciiBorder))]
|
||||
[InlineData(BorderKind.Square, false, typeof(SquareBorder))]
|
||||
[InlineData(BorderKind.Rounded, false, typeof(RoundedBorder))]
|
||||
[InlineData(BorderKind.None, true, typeof(NoBorder))]
|
||||
[InlineData(BorderKind.Ascii, true, typeof(AsciiBorder))]
|
||||
[InlineData(BorderKind.Square, true, typeof(SquareBorder))]
|
||||
[InlineData(BorderKind.Rounded, true, typeof(SquareBorder))]
|
||||
public void Should_Return_Correct_Border_For_Specified_Kind(BorderKind kind, bool safe, Type expected)
|
||||
{
|
||||
// Given, When
|
||||
var result = Border.GetBorder(kind);
|
||||
var result = Border.GetBorder(kind, safe);
|
||||
|
||||
// Then
|
||||
result.ShouldBeOfType(expected);
|
||||
@ -26,7 +31,7 @@ namespace Spectre.Console.Tests.Unit.Composition
|
||||
public void Should_Throw_If_Unknown_Border_Kind_Is_Specified()
|
||||
{
|
||||
// Given, When
|
||||
var result = Record.Exception(() => Border.GetBorder((BorderKind)int.MaxValue));
|
||||
var result = Record.Exception(() => Border.GetBorder((BorderKind)int.MaxValue, false));
|
||||
|
||||
// Then
|
||||
result.ShouldBeOfType<InvalidOperationException>();
|
||||
|
Reference in New Issue
Block a user