@@ -52,26 +52,17 @@ public class SerializationTest
5252 {
5353 new StringEnumConverter ( )
5454 } ,
55- NullValueHandling = NullValueHandling . Include , // changed
55+ NullValueHandling = NullValueHandling . Ignore ,
5656 StringEscapeHandling = StringEscapeHandling . EscapeHtml ,
57+ Formatting = Formatting . Indented
5758 } ;
5859
5960 private readonly string jsonCustom =
60- "{" +
61- "\" @context\" :\" http://schema.org\" ," +
62- "\" @type\" :\" Person\" ," +
63- "\" @id\" :null," +
64- "\" name\" :\" J.D. Salinger\\ u003c/script\\ u003e\\ u003cscript\\ u003ealert(\\ u0027gotcha\\ u0027);\\ u003c/script\\ u003e\" ," +
65- "\" description\" :null,\" additionalType\" :null,\" alternateName\" :null,\" disambiguatingDescription\" :null,\" identifier\" :null," +
66- "\" image\" :null,\" mainEntityOfPage\" :null,\" potentialAction\" :null,\" sameAs\" :null,\" url\" :null,\" additionalName\" :null," +
67- "\" address\" :null,\" affiliation\" :null,\" alumniOf\" :null,\" award\" :null,\" birthDate\" :null,\" birthPlace\" :null,\" brand\" :null," +
68- "\" children\" :null,\" colleague\" :null,\" contactPoint\" :null,\" deathDate\" :null,\" deathPlace\" :null,\" duns\" :null,\" email\" :null," +
69- "\" familyName\" :null,\" faxNumber\" :null,\" follows\" :null,\" funder\" :null,\" gender\" :null,\" givenName\" :null," +
70- "\" globalLocationNumber\" :null,\" hasOfferCatalog\" :null,\" hasPOS\" :null,\" height\" :null,\" homeLocation\" :null," +
71- "\" honorificPrefix\" :null,\" honorificSuffix\" :null,\" isicV4\" :null,\" jobTitle\" :null,\" knows\" :null,\" makesOffer\" :null," +
72- "\" memberOf\" :null,\" naics\" :null,\" nationality\" :null,\" netWorth\" :null,\" owns\" :null,\" parent\" :null,\" performerIn\" :null," +
73- "\" publishingPrinciples\" :null,\" relatedTo\" :null,\" seeks\" :null,\" sibling\" :null,\" sponsor\" :null,\" spouse\" :null,\" taxID\" :null," +
74- "\" telephone\" :null,\" vatID\" :null,\" weight\" :null,\" workLocation\" :null,\" worksFor\" :null}" ;
61+ "{\r \n " +
62+ " \" @context\" : \" http://schema.org\" ,\r \n " +
63+ " \" @type\" : \" Person\" ,\r \n " +
64+ " \" name\" : \" J.D. Salinger\\ u003c/script\\ u003e\\ u003cscript\\ u003ealert(\\ u0027gotcha\\ u0027);\\ u003c/script\\ u003e\" \r \n " +
65+ "}" ;
7566
7667 [ Fact ]
7768 public void ToString_UnsafeBookData_ReturnsExpectedJsonLd ( ) =>
0 commit comments