I have been using strictly Microsoft Fakes for Unit Testing. (therefore, I do not want nUnit or other examples.) I am able to create a Stub for a class which I previously thought would not be possible under the condition that classes need to implement interface to be stubbed. I believe I can create the stub due to the use of dependency injection, although I am not sure... (if anyone has more information on this It would be highly appreciated.)
Although that in itself may be the issue, I would like to see an example with the syntax to Stub a property Getter or Setter with VB.net and Microsoft Fakes. Microsoft does not have nearly as many hard examples of using Fakes with VB.net (just C#) and this has cost me hours of trying to determine the difference, as Vb.net itself is also somewhat new for me.
In this example specifically, we have a large class called Plan which in this specific case has a property Clusters which is of type ClusterCollection. I would like to Stub the Plan.Clusters getter to return a self defined ClusterCollection. This is the code I have tried to write to perfrom this and It has not worked...
Dim cc As New ClusterCollection
'I would add elements to CC here.
Dim myPlan As New StubPlan
With myPlan
.ClustersGet= _
Function()
Return cc
End Function
End With
99% sure this is not the way to do it but intellisense isn't helping me much either. Help???