public void ShouldThrowIfReaderIsNull() { // Arrange var writer = new ProtoDataWriter(); var stream = new MemoryStream(); // Assert Assert.Throws <ArgumentNullException>(() => writer.Serialize(stream, (IDataReader)null)); }
public void ShouldThrowIfStreamIsNull() { // Arrange var writer = new ProtoDataWriter(); var dataReader = this.CreateDataReader(1); // Assert Assert.Throws <ArgumentNullException>(() => writer.Serialize(null, dataReader)); }
private Stream Serialize(IDataReader dataReader, ProtoDataWriterOptions options = null) { var writer = new ProtoDataWriter(); var stream = new MemoryStream(); writer.Serialize(stream, dataReader); stream.Position = 0; return(stream); }