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 2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
4
using System . IO ;
5
+ using System . Text . Encodings . Web ;
5
6
using Microsoft . Extensions . WebEncoders . Testing ;
6
7
using Xunit ;
7
8
@@ -22,5 +23,19 @@ public void WriteTo_WritesContent()
22
23
Assert . Equal ( "HtmlEncode[[Hello World]]" , writer . ToString ( ) ) ;
23
24
}
24
25
}
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
+ }
25
40
}
26
41
}
You can’t perform that action at this time.
0 commit comments