-Refactored enum name writing

-Improved performance of reading and writing enum names
-Tests
This commit is contained in:
James Newton-King
2018-01-01 13:15:08 +13:00
parent 2244a82282
commit eb85ba3f7c
7 changed files with 454 additions and 47 deletions
@@ -201,6 +201,32 @@ namespace Newtonsoft.Json.Tests
]
}", sw.ToString());
}
[Test]
public async Task WriteLazy_Property()
{
LazyStringWriter sw = new LazyStringWriter(CultureInfo.InvariantCulture);
using (JsonTextWriter writer = new JsonTextWriter(sw))
{
writer.Indentation = 4;
writer.Formatting = Formatting.Indented;
await writer.WriteStartArrayAsync();
await writer.WriteStartObjectAsync();
await writer.WritePropertyNameAsync("IncompleteProp");
await writer.WriteEndArrayAsync();
}
StringAssert.AreEqual(@"[
{
""IncompleteProp"": null
}
]", sw.ToString());
}
#endif
[Test]