This example is taken directly from the moq4 github repo. It should be enough to give you an idea of how to use mock. If more details are needed review the moq github repo link above.
var mock = new Mock<ILoveThisFramework>(); // WOW! No record/replay weirdness?! :) mock.Setup(p => p.DownloadExists("22.214.171.124")) .Returns(true); // Hand mock.Object as a collaborator and exercise it, // like calling methods on it... ILoveThisFramework lovable = mock.Object; bool download = lovable.DownloadExists("126.96.36.199"); // Verify that the given method was indeed called with the expected value at most once mock.Verify(p => p.DownloadExists("188.8.131.52"), Times.AtMostOnce());