Beispiel #1
0
        public void WriteTo_WritesContent()
        {
            // Arrange & Act
            var content = new StringHtmlContent("Hello World");

            // Assert
            using (var writer = new StringWriter())
            {
                content.WriteTo(writer, new HtmlTestEncoder());
                Assert.Equal("HtmlEncode[[Hello World]]", writer.ToString());
            }
        }
Beispiel #2
0
        public void Emoji_EncodedCorrectly()
        {
            // Arrange & Act
            var tearsOfJoy = new StringHtmlContent("😂2");

            // Assert
            using (var stringWriter = new StringWriter())
            {
                tearsOfJoy.WriteTo(stringWriter, HtmlEncoder.Default);
                Assert.Equal("😂2", stringWriter.ToString(), ignoreCase: true);
            }
        }
Beispiel #3
0
        public void WriteTo_WritesContent()
        {
            // Arrange & Act
            var content = new StringHtmlContent("Hello World");

            // Assert
            using (var writer = new StringWriter())
            {
                content.WriteTo(writer, new HtmlTestEncoder());
                Assert.Equal("HtmlEncode[[Hello World]]", writer.ToString());
            }
        }