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