public static byte[] GetFilledDataBlockBlob() { var stream = new MemoryStream(); using (var buffer = new BinaryWriteBuffer(1024, stream)) { var visitor = new PackedDataWriteVisitor(buffer); var traveller = DataBlockHardCodedTraveller.Create(); traveller.Travel(visitor, DataBlock.Filled()); } var bytes = stream.ToArray(); return(bytes); }
public void ReadHardCodedTravelTest() { var bytes = BinarySerializationTestContext.GetFilledDataBlockBlob(); var stream = new MemoryStream(bytes); var visitor = new PackedDataReadVisitor(stream); var traveller = DataBlockHardCodedTraveller.Create(); var graph = new DataBlock(); traveller.Travel(visitor, graph); var expected = DataBlock.Filled(); graph.AssertEqualTo(expected); }