コード例 #1
0
 public async Task TestSpanReplacementEngineUnicodeEscape()
 {
     var config = new EscapeRoute.EscapeRouteConfiguration()
     {
         UnicodeBehavior = UnicodeBehavior.Escape
     };
     EscapeRoute.Abstractions.Interfaces.IEscapeRouter escapeRouter = new EscapeRoute.EscapeRouter(config);
     const string inputString = "The quick brown fox jumps over the lazy dog. ( ͡° ͜ʖ ͡°). Something else.";
     const string expected = @"The quick brown fox jumps over the lazy dog. ( \u0361\u00b0 \u035c\u0296 \u0361\u00b0). Something else.";
     var result = await escapeRouter.ParseAsync(inputString);
     Assert.Equal(expected, result);
 }
コード例 #2
0
        public async Task TestSpanReplacementEngineNewLineEscape()
        {
            var config = new EscapeRoute.EscapeRouteConfiguration
            {
                NewLineBehavior = NewLineBehavior.Escape
            };

            EscapeRoute.Abstractions.Interfaces.IEscapeRouter escapeRouter = new EscapeRoute.EscapeRouter(config);
            const string inputString = "The quick brown fox jumps over the lazy dog.\n Something else.";
            const string expected    = @"The quick brown fox jumps over the lazy dog.\n Something else.";
            var          result      = await escapeRouter.ParseAsync(inputString);

            Assert.Equal(expected, result);
        }