I am evaluating TypeMock Isolator for potential purchase for my development team, which is tasked with working on some gnarly legacy code, much of it VB.NET, so I'm very intrigued about the "mock everything" ethos, and TypeMock's abilities in this area. In my evaluation against our codebase, I've encountered the following scenario, and I'd love it if someone could explain to me the right way to pull of this particular mock, on a VB.NET base class.
This streamlined example demonstrates my issue:
Public MustInherit Class BaseClass
Public Function PublicFunction() As Boolean
Private Function PrivateFunction() As Boolean
Public Class InheritingClass
Public Class TestIt
Public Sub ShouldBeAbleToMockPrivateFunctionOnBaseClass()
Dim mock As Mock = MockManager.Mock(GetType(BaseClass))
Dim ic As New InheritingClass()
The test fails because the mock I've created here doesn't seem to be acknowledged on the base class. I've tried this same style of test on a more straightforward class that does not inherit, and that works fine. Is there a change I can do to this example that will allow me to mock the private function of the base class, without having to refactor the class' access modifiers in any way?
Thanks in advance!