I'm using the Setup() method to set up the behaviour of a mocked instance of an interface.
The method I'm setting up (let's call it DoSomething()) accepts an instance of a class (let's call the class Foo).
Foo foo = // Existing foo instance
Mock<IMyInterface> mock = new Mock<IMyInterface>();
mock.Setup(x => x.DoSomething(foo)).Returns(1);
The problem I'm having is that when I use the mock, it never matches the setup, so never returns 1.
Can anyone help? How does Moq determine whether the parameters provided to a set up method are equal or not?