public void WritePropertyNamePrependsPropertyNameWithComaWhenCurrentObjectAlreadyHasProperties() { using (var stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { var JsonSerializationWriter = new TestableJsonSerializationWriter(stringWriter); JsonSerializationWriter.WritePropertyName("Property1"); JsonSerializationWriter.WritePropertyName("Property2"); AssertEx.Contains(",\"Property2\"", stringWriter.ToString(), StringComparison.OrdinalIgnoreCase); } }
public void WritePropertyNameDoesNotPrependPropertyNameWithComaWhenNewObjectWasStarted() { using (var stringWriter = new StringWriter(CultureInfo.InvariantCulture)) { var JsonSerializationWriter = new TestableJsonSerializationWriter(stringWriter); JsonSerializationWriter.WritePropertyName("Property1"); JsonSerializationWriter.WriteStartObject(); JsonSerializationWriter.WritePropertyName("Property2"); AssertEx.Contains("{\"Property2\"", stringWriter.ToString(), StringComparison.OrdinalIgnoreCase); } }