Fix WriteLargeKeyOrValue System.Text.Json test (dotnet/corefx#39857)
authorStephen Toub <stoub@microsoft.com>
Mon, 29 Jul 2019 20:10:36 +0000 (16:10 -0400)
committerGitHub <noreply@github.com>
Mon, 29 Jul 2019 20:10:36 +0000 (16:10 -0400)
commit837a4e7f3711e9e666d549e76e318bf9b2f4e61c
treeebbdffd76fe5be22d75c9167295045dd30ff28f4
parent573ecf1d614388d9841e0ebe204bcf968484c3ee
Fix WriteLargeKeyOrValue System.Text.Json test (dotnet/corefx#39857)

When the Utf8JsonWriter is disposed in the first part of the test, it flushes the WriteStartObject token to the ArrayBufferWriter, such that the output.WrittenCount is already 1 when the second part of the test starts, and then the Assert.Equal(0, output.WrittenCount) is doomed to fail.

Commit migrated from https://github.com/dotnet/corefx/commit/9e994a5923d426f0e64ed3b8f9b93df6f214a42a
src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs