File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -84,5 +84,23 @@ public void ToHtmlEscapedString_UnsafeBookData_ReturnsExpectedJsonLd() =>
8484 [ Fact ]
8585 public void ToStringWithCustomSerializerSettings_UnsafeAuthorData_ReturnsExpectedJsonLd ( ) =>
8686 Assert . Equal ( this . jsonCustom , Person . ToString ( this . customSerializerSettings ) ) ;
87+
88+ [ Fact ]
89+ public void ToStringWithNullAssignedProperty_ReturnsExpectedJsonLd ( )
90+ {
91+ var localBusiness = new LocalBusiness ( )
92+ {
93+ PriceRange = "$$$" ,
94+ Address = null
95+ } ;
96+ var actual = localBusiness . ToString ( ) ;
97+ var expected =
98+ "{" +
99+ "\" @context\" :\" http://schema.org\" ," +
100+ "\" @type\" :\" LocalBusiness\" ," +
101+ "\" priceRange\" :\" $$$\" " +
102+ "}" ;
103+ Assert . Equal ( expected , actual ) ;
104+ }
87105 }
88106}
You can’t perform that action at this time.
0 commit comments