Hi there.
Many thanks for the replies.
I tried to use the ObjectState idea, but I can't seem to get it to work correctly. Here's my test code:
<TestMethod()> _
Public Sub AnotherTest()
Dim fakePerson As Person = FakeInstance(Of Person)()
Dim os As New ObjectState(fakePerson)
os.SetField("m_Age", 56)
Using TheseCalls.WillCallOriginal
fakePerson.GetName()
End Using
SwapNextInstance(Of Person)(fakePerson)
DoSomething()
End Sub
Here's the code for the class I'm using:
Public Class Person
Private m_Age As Integer
Public Function GetName() As String
Return "Jason Evans and I'm " & m_Age & " old."
End Function
End Class
Basically I'm just trying to see how I can mix AAA and field mocking into the same unit test. The result of running the above test is:
Jason Evans and I'm 0 old.
Would someone be able to help me out with this?
Cheers.
Jas.