public override IAsyncResult BeginWrite(byte[] array, int offset, int count, AsyncCallback asyncCallback, object asyncState) => TaskToApm.Begin(WriteAsync(array, offset, count, CancellationToken.None), asyncCallback, asyncState);
public void AsyncWrite () { GZipStream cs = new GZipStream (new MemoryStream (), CompressionMode.Compress); message = "AsyncWrite"; reset.Reset (); IAsyncResult r = cs.BeginWrite (new byte[0], 0, 0, new AsyncCallback (WriteCallback), cs); Assert.IsNotNull (r, "IAsyncResult"); if (!reset.WaitOne (timeout, true)) Assert.Ignore ("Timeout"); Assert.IsNull (message, message); // the Close is currently buggy in Mono // cs.Close (); }