Hi
Here is how its done in natural mocks:
<Test()> _
Public Sub SomeTest2()
Using recorder As New RecordExpectations
Dim mockList As New StringList
'this is instead of Constructor.NotMocked
recorder.CallOriginal()
mockList.Fill()
'Set the return value
recorder.Return(New DynamicReturnValue(AddressOf Me.DynamicFill))
End Using
'Execute code:
Dim list As New StringList
list.doSomething()
'Verify results:
Assert.AreEqual(2, list.Count)
Assert.AreEqual("mockString1", list(0))
End Sub
Generally speaking you call the methods you want to mock
inside the 'Using' block (Just like you will do in production code)
and use the recorder object to set the expectations.