Moq – Mocking a cast on an interface

Mocking a Cast on a Mocked Interface The Setup var mockedInterface = new Mock<IInterface>(); mockedInterface.As().Setup(i => i.MethodOnTheInterface()); Easy as that! Been working with Moq a fair bit recently. Some other Moq tips and tricks here.