Using Moq to override virtual methods in the same class

You can probably use partial mocking in this scenario, although all your methods would need to be virtual:

    var mock = new Moq.Mock<RenewalService>();
    mock.Setup(m => m.GetNextRenewalDate(It.IsAny<Guid>())).Returns(null);
    mock.CallBase = true;
    var results = mock.Object.IsLastRenewalOfYear(...);

Leave a Comment