mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-07-07 13:08:14 +08:00
Rename Style
and Appearance
* Renames Style -> Decoration * Renames Appearance -> Style * Adds Style.Parse and Style.TryParse
This commit is contained in:

committed by
Patrik Svensson

parent
c3286a4842
commit
98cf63f485
@ -12,17 +12,17 @@ namespace Spectre.Console.Tests.Unit
|
||||
public void Should_Split_Segment_Correctly()
|
||||
{
|
||||
// Given
|
||||
var appearance = new Appearance(Color.Red, Color.Green, Styles.Bold);
|
||||
var segment = new Segment("Foo Bar", appearance);
|
||||
var style = new Style(Color.Red, Color.Green, Decoration.Bold);
|
||||
var segment = new Segment("Foo Bar", style);
|
||||
|
||||
// When
|
||||
var (first, second) = segment.Split(3);
|
||||
|
||||
// Then
|
||||
first.Text.ShouldBe("Foo");
|
||||
first.Appearance.ShouldBe(appearance);
|
||||
first.Style.ShouldBe(style);
|
||||
second.Text.ShouldBe(" Bar");
|
||||
second.Appearance.ShouldBe(appearance);
|
||||
second.Style.ShouldBe(style);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ namespace Spectre.Console.Tests.Unit
|
||||
// Given
|
||||
var fixture = new AnsiConsoleFixture(ColorSystem.Standard);
|
||||
var text = Text.New("Hello World");
|
||||
text.Stylize(start: 3, end: 8, new Appearance(style: Styles.Underline));
|
||||
text.Stylize(start: 3, end: 8, new Style(decoration: Decoration.Underline));
|
||||
|
||||
// When
|
||||
fixture.Console.Render(text);
|
||||
@ -62,7 +62,7 @@ namespace Spectre.Console.Tests.Unit
|
||||
// Given
|
||||
var fixture = new AnsiConsoleFixture(ColorSystem.Standard, width: 5);
|
||||
var text = Text.New("Hello World");
|
||||
text.Stylize(start: 3, end: 8, new Appearance(style: Styles.Underline));
|
||||
text.Stylize(start: 3, end: 8, new Style(decoration: Decoration.Underline));
|
||||
|
||||
// When
|
||||
fixture.Console.Render(text);
|
||||
|
Reference in New Issue
Block a user