I hope you know, because I don’t see it. Bonus points for whoever figures out how one can achieve what this test is trying to achieve.
using NUnit.Framework; using Moq; [TestFixture] public class MoqHuh { public class A {} public class B : A {} public interface IHelper { void DoIt(A a); } [Test] public void Huh() { var mock = new Mock<IHelper>(); mock.Expect(helper => helper.DoIt(It.IsAny<B>())).Verifiable(); mock.Object.DoIt(new B()); mock.VerifyAll(); } }
Turns out this was sort of pilot error. I incorrectly assumed Moq working fine on Mono. (which it looks like it does just fine). This issue only happens when compiled with mono’s gmcs, not when compiled with Microsofts csc.
I have reported the appropriate bugs with the mono team, and will continue towards making sure the full Moq test suite passes when compiled with mono’s gmcs.exe
Sorry for the noise.
Lucas