public void A_simple_formattable_string_can_be_converted_to_a_ContentSpan() { var span = new TextSpanFormatter().ParseToSpan($"some text"); span.Should() .BeOfType <ContentSpan>() .Which .Content .Should() .Be("some text"); }
public void A_formattable_string_containing_ansi_codes_can_be_converted_to_a_ContainerSpan() { var span = new TextSpanFormatter().ParseToSpan( $"some {StyleSpan.BlinkOn()}blinking{StyleSpan.BlinkOff()} text" ); var containerSpan = span.Should().BeOfType <ContainerSpan>().Subject; containerSpan .Should() .BeEquivalentTo( new ContainerSpan( new ContentSpan("some "), StyleSpan.BlinkOn(), new ContentSpan("blinking"), StyleSpan.BlinkOff(), new ContentSpan(" text") ), options => options.WithStrictOrdering().Excluding(s => s.Parent).Excluding(s => s.Root) ); }