private static void WriteEntryAndValidatePayload(ODataEntry entry, MemoryStream stream, ODataJsonLightWriter writer, string expectedPayload)
 {
     writer.WriteStart(entry);
     writer.WriteEnd();
     writer.Flush();
     stream.Seek(0, SeekOrigin.Begin);
     string payload = (new StreamReader(stream)).ReadToEnd();
     payload.Should().Be(expectedPayload);
 }
 private static void ValidateWrittenPayload(MemoryStream stream, ODataJsonLightWriter writer, string expectedPayload)
 {
     writer.Flush();
     stream.Seek(0, SeekOrigin.Begin);
     string payload = (new StreamReader(stream)).ReadToEnd();
     payload.Should().Be(expectedPayload);
 }