Skip to content

Instantly share code, notes, and snippets.

@einaros
Created October 22, 2010 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einaros/640422 to your computer and use it in GitHub Desktop.
Save einaros/640422 to your computer and use it in GitHub Desktop.
var mock = new Mock<MemoryStream>();
mock
.Setup(x => x.Read(It.IsAny<byte[]>(), It.IsAny<int>(), It.IsAny<int>()))
.Callback((byte[] array, int offset, int length) => Console.Out.WriteLine(array == null));
mock.Object.Read(new byte[1], 1, 2);
@einaros
Copy link
Author

einaros commented Oct 22, 2010

"array" will be null in the callback, when run through Moq 3.1.416.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment