Merge pull request #754 from JonHanna/fix_752

Null Check on JsonWriter.WriteToken
This commit is contained in:
James Newton-King
2015-12-21 21:57:46 +13:00
2 changed files with 11 additions and 1 deletions
@@ -897,6 +897,16 @@ Parameter name: value");
}
}
[Test]
public void WriteTokenNullCheck()
{
using (JsonWriter jsonWriter = new JsonTextWriter(new StringWriter()))
{
ExceptionAssert.Throws<ArgumentNullException>(() => { jsonWriter.WriteToken(null); });
ExceptionAssert.Throws<ArgumentNullException>(() => { jsonWriter.WriteToken(null, true); });
}
}
[Test]
public void BadWriteEndArray()
{