File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
src/Mvc/Mvc.ViewFeatures/test Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 22// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
44using System . IO ;
5+ using System . Text . Encodings . Web ;
56using Microsoft . Extensions . WebEncoders . Testing ;
67using Xunit ;
78
@@ -22,5 +23,19 @@ public void WriteTo_WritesContent()
2223 Assert . Equal ( "HtmlEncode[[Hello World]]" , writer . ToString ( ) ) ;
2324 }
2425 }
26+
27+ [ Fact ]
28+ public void Emoji_EncodedCorrectly ( )
29+ {
30+ // Arrange & Act
31+ var tearsOfJoy = new StringHtmlContent ( "😂2" ) ;
32+
33+ // Assert
34+ using ( var stringWriter = new StringWriter ( ) )
35+ {
36+ tearsOfJoy . WriteTo ( stringWriter , HtmlEncoder . Default ) ;
37+ Assert . Equal ( "😂2" , stringWriter . ToString ( ) , ignoreCase : true ) ;
38+ }
39+ }
2540 }
2641}
You can’t perform that action at this time.
0 commit comments