public static IReturnsResult <Stream> ReturnsCompletedSynchronously(this ISetup <Stream, IAsyncResult> setup) { if (setup == null) { throw new ArgumentNullException(nameof(setup)); } return(setup.Returns <byte[], int, int, AsyncCallback, object>((i1, i2, i3, callback, state) => { IAsyncResult result = new CompletedAsyncResult(state); InvokeCallback(callback, result); return result; })); }
public static IReturnsResult<Stream> ReturnsCompletedSynchronously(this ISetup<Stream, IAsyncResult> setup) { if (setup == null) { throw new ArgumentNullException("setup"); } return setup.Returns<byte[], int, int, AsyncCallback, object>((i1, i2, i3, callback, state) => { IAsyncResult result = new CompletedAsyncResult(state); InvokeCallback(callback, result); return result; }); }