File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,32 @@ public void Can_serialize_and_deserialize_arrays_of_class_objects()
119119 OutputHelper . WriteLine ( "" ) ;
120120 }
121121
122+ [ TestMethod ]
123+ public void Can_deserialize_string_starting_with_unicode_escape ( )
124+ {
125+
126+ OutputHelper . WriteLine ( "Starting test..." ) ;
127+
128+ Console . WriteLine ( $ "{ TimeSpan . FromHours ( 1 ) . TotalMilliseconds } ") ;
129+
130+ JsonTestCompany test = new JsonTestCompany
131+ {
132+ CompanyID = 10 ,
133+ CompanyName = "5 Guys"
134+ } ;
135+
136+ var jsonString = "{\u0022 CompanyID\u0022 :10,\u0022 CompanyName\u0022 :\u0022 5 Guys\u0022 }" ;
137+
138+
139+ JsonTestCompany deserializedResult = ( JsonTestCompany ) JsonConvert . DeserializeObject ( jsonString , typeof ( JsonTestCompany ) ) ;
140+
141+ Assert . NotNull ( deserializedResult ) ;
142+ Assert . Equal ( "5 Guys" , deserializedResult . CompanyName ) ;
143+ Assert . Equal ( 10 , deserializedResult . CompanyID ) ;
144+
145+ OutputHelper . WriteLine ( "Finished test..." ) ;
146+ }
147+
122148 [ TestMethod ]
123149 public void Can_serialize_and_deserialize_arrays_of_class_objects_when_array_items_may_be_null ( )
124150 {
You can’t perform that action at this time.
0 commit comments