Rename Style and Appearance

* Renames Style -> Decoration
* Renames Appearance -> Style
* Adds Style.Parse and Style.TryParse
This commit is contained in:
Patrik Svensson
2020-08-03 22:33:08 +02:00
committed by Patrik Svensson
parent c3286a4842
commit 98cf63f485
32 changed files with 691 additions and 405 deletions

View File

@ -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);
}
}

View File

@ -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);