public void WritePropertyWithNullWriter() { JsonTextWriter writer = null; const string propertyName = "mockPropertyName"; const string propertyValue = "mockPropertyValue"; Assert.Throws <ArgumentNullException>(() => { ResourceSchemaWriter.WriteProperty(writer, propertyName, propertyValue); }); }
public void WritePropertyWithNullPropertyName() { StringWriter stringWriter = new StringWriter(); JsonTextWriter writer = new JsonTextWriter(stringWriter); writer.QuoteChar = '\''; const string propertyName = null; const string propertyValue = "mockPropertyValue"; Assert.Throws <ArgumentException>(() => { ResourceSchemaWriter.WriteProperty(writer, propertyName, propertyValue); }); }
public void WritePropertyWithNonWhitespacePropertyValue() { StringWriter stringWriter = new StringWriter(); JsonTextWriter writer = new JsonTextWriter(stringWriter); writer.QuoteChar = '\''; const string propertyName = "mockPropertyName"; const string propertyValue = "mockPropertyValue"; ResourceSchemaWriter.WriteProperty(writer, propertyName, propertyValue); Assert.Equal("'mockPropertyName':'mockPropertyValue'", stringWriter.ToString()); }