public void plain_string_is_properly_parsed(string str) { CrayonString crayon = new CrayonString(str); var tokens = crayon.Tokenize(); var sb = new StringBuilder(); foreach (var token in tokens) { sb.Append(token.Text); } var removedExcapes = str.Replace($"{CrayonString.escapeStart}{CrayonString.escapeStart}", $"{CrayonString.escapeStart}"); sb.ToString().ShouldEqual(removedExcapes); }
public void colors_are_properly_parsed(string str) { CrayonString crayon = new CrayonString(str); var tokens = crayon.Tokenize(); var sb = new StringBuilder(); foreach (var token in tokens) { sb.Append(CrayonString.escapeStart) .Append(token.Color.OriginalName) .Append(CrayonString.escapeEnd); sb.Append(token.Text); } //var removedExcapes = str.Replace($"{CrayonString.escapeStart}{CrayonString.escapeStart}", $"{CrayonString.escapeStart}"); sb.ToString().ShouldEqual(str); }