Using Moq to Mock a Func constructor parameter and Verify it was called twice
I don’t think it is necessary to use a mock for the Func. You can simply create an ordinary Func yourself that returns a mock of IFooBarProxy: int numberOfCalls = 0; Func<IFooBarProxy> func = () => { ++numberOfCalls; return new Mock<IFooBarProxy>(); }; var sut = new FooBar(func); sut.Process(); Assert.Equal(2, numberOfCalls);