parent
7d7a3c9c81
commit
8a81e3a25f
|
|
@ -2,6 +2,7 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.IO;
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.Extensions.WebEncoders.Testing;
|
||||
using Xunit;
|
||||
|
||||
|
|
@ -22,5 +23,19 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
|||
Assert.Equal("HtmlEncode[[Hello World]]", writer.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue