public When_reading_from_a_stream_containing_multiple_data_tables_with_big_buffer() { var testData = new DataSet { Tables = { TestData.GenerateRandomDataTable(10, 50), TestData.GenerateRandomDataTable(5, 100), TestData.GenerateRandomDataTable(20, 10000) } }; using (var r = testData.CreateDataReader()) using (var memoryStream = new MemoryStream()) { DataSerializer.Serialize(memoryStream, r); this.expectedBytes = memoryStream.GetTrimmedBuffer(); } this.reader = testData.CreateDataReader(); using (var stream = new ProtoDataStream(this.reader, 50 * 1024 * 1024)) // 50 Mb buffer which using (var memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); this.actualBytes = memoryStream.GetTrimmedBuffer(); } }
public void SetUp() { var testData = new DataSet { Tables = { TestData.GenerateRandomDataTable(10, 50), TestData.GenerateRandomDataTable(5, 100), TestData.GenerateRandomDataTable(20, 10000) } }; using (var r = testData.CreateDataReader()) using (var memoryStream = new MemoryStream()) { DataSerializer.Serialize(memoryStream, r); expectedBytes = memoryStream.GetTrimmedBuffer(); } reader = testData.CreateDataReader(); using (var stream = new ProtoDataStream(reader)) using (var memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); actualBytes = memoryStream.GetTrimmedBuffer(); } }
public When_reading_from_a_stream_with_varying_buffer_sizes() { this.testData = TestData.GenerateRandomDataTable(10, 10000); using (var reader = this.testData.CreateDataReader()) using (var memoryStream = new MemoryStream()) { DataSerializer.Serialize(memoryStream, reader); this.expectedBytes = memoryStream.GetTrimmedBuffer(); } }
public void SetUp() { testData = TestData.GenerateRandomDataTable(10, 10000); using (var reader = testData.CreateDataReader()) using (var memoryStream = new MemoryStream()) { DataSerializer.Serialize(memoryStream, reader); expectedBytes = memoryStream.GetTrimmedBuffer(); } }
public When_disposing_the_read_before_all_the_data_has_been_read() { var testData = TestData.GenerateRandomDataTable(10, 10000); this.reader = testData.CreateDataReader(); this.stream = new ProtoDataStream(this.reader); var buffer = new byte[512]; this.stream.Read(buffer, 0, buffer.Length); this.stream.Read(buffer, 0, buffer.Length); this.stream.Read(buffer, 0, buffer.Length); this.stream.Dispose(); }
public void SetUp() { var testData = TestData.GenerateRandomDataTable(10, 10000); reader = testData.CreateDataReader(); stream = new ProtoDataStream(reader); var buffer = new byte[512]; stream.Read(buffer, 0, buffer.Length); stream.Read(buffer, 0, buffer.Length); stream.Read(buffer, 0, buffer.Length); stream.Dispose(); }
public When_reading_from_a_stream() { var testData = TestData.GenerateRandomDataTable(10, 10000); using (var r = testData.CreateDataReader()) using (var memoryStream = new MemoryStream()) { DataSerializer.Serialize(memoryStream, r); this.expectedBytes = memoryStream.GetTrimmedBuffer(); } this.reader = testData.CreateDataReader(); using (var stream = new ProtoDataStream(this.reader)) using (var memoryStream = new MemoryStream()) { stream.CopyTo(memoryStream); this.actualBytes = memoryStream.GetTrimmedBuffer(); } }