How do I Moq It.IsAny for an array in the setup of a method?

Posted by Graham on Stack Overflow See other posts from Stack Overflow or by Graham
Published on 2010-03-18T17:25:33Z Indexed on 2010/03/18 17:31 UTC
Read the original article Hit count: 286

Filed under:
|
|

I'm brand new to Moq (using v 4) and am struggling a little with the documentation.

What I'm trying to do is to Moq a method that takes a byte array and returns an object. Something like:

decoderMock.Setup(d => d.Decode(????).Returns(() => tagMock.Object);

The ???? is where the byte[] should be, but I can't work out how to make it so that I don't care what's in the byte array, just return the mocked object I've already set up.

Moq.It.IsAny expects a generic.

Any help please?

© Stack Overflow or respective owner

Related posts about moq

Related posts about setup