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)
                );
        }
Ejemplo n.º 2
0
 public void FormatSpans_do_not_have_default_string_representations()
 {
     $"{ForegroundColorSpan.DarkGray()}The {BackgroundColorSpan.Cyan()}quick{StyleSpan.BlinkOn()} brown fox jumped over the lazy dog.{StyleSpan.BoldOff()}{ForegroundColorSpan.Reset()}{BackgroundColorSpan.Reset()}"
     .Should()
     .Be("The quick brown fox jumped over the lazy dog.");
 }
Ejemplo n.º 3
0
 public static void OutputBlink(this ITerminal terminal, string content)
 {
     terminal.Render(StyleSpan.BlinkOn());
     terminal.Output(content);
     terminal.Render(StyleSpan.BlinkOff());
 }
Ejemplo n.º 4
0
 public void WriteBlink(string content)
 {
     Terminal.Render(StyleSpan.BlinkOn());
     Write(content);
     Terminal.Render(StyleSpan.BlinkOff());
 }