mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-08-03 02:17:59 +08:00
Fixed link not dispalyed in markup in Style.cs and added unit test cases (#1750)
This commit is contained in:
@ -405,5 +405,31 @@ public sealed class StyleTests
|
||||
// Then
|
||||
result.ShouldBe("default on green");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Should_Return_Expected_Markup_For_Style_With_Only_Link()
|
||||
{
|
||||
// Given
|
||||
var style = new Style(link:"https://spectreconsole.net/");
|
||||
|
||||
// When
|
||||
var result = style.ToMarkup();
|
||||
|
||||
// Then
|
||||
result.ShouldBe("link=https://spectreconsole.net/");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Should_Return_Expected_Markup_For_Style_With_Background_And_Link()
|
||||
{
|
||||
// Given
|
||||
var style = new Style(background: Color.Blue, link: "https://spectreconsole.net/");
|
||||
|
||||
// When
|
||||
var result = style.ToMarkup();
|
||||
|
||||
// Then
|
||||
result.ShouldBe("default on blue link=https://spectreconsole.net/");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user