I have a function TryGetValues
that receives a TKey and ByRef a TValue, and I need when I mock this function to return me something. I need the value of TValue because later in the method I'm testing I'm going to need this. The way I use to test it is:
Dim agent = Mock.Get(Of ICalcAgent)()
Dim connections As IList(Of ICalcMapConnection) = Nothing
agent.CalcMap = Mock.Get(Of ICalcMap)()
agent.CalcMap.Stub(Function(x) x.TryGetCategoryChildren(agent, connections)).IgnoreArguments().OutRef(agent, connections).Repeat.Once().Return(True)
In this case I need Connections to be something. How do I do that with Rhino?
Sub AddConnection(ByRef cnn As ICalcMapConnection)
Sub AssignWeightToConnections()
Function TryGetCategoryParents(ByRef agent As ICalcAgent, ByRef parentsList As IList(Of ICalcMapConnection)) As Boolean
Function TryGetCategoryChildren(ByRef agent As ICalcAgent, ByRef childrenList As IList(Of ICalcMapConnection)) As Boolean
ReadOnly Property MapType() As MapType
Function GetMaxWeight(ByVal categoryId As Integer) As Integer
Function HasConnection(ByVal connection As ICalcMapConnection) As Boolean
Function HasCategory(ByVal categoryId As Integer) As Boolean
Function GetLeafCategories() As IEnumerable(Of Integer)
Function GetCategoryDefinition(ByRef agent As Interfaces.ICalcAgent) As ICalcMapConnection
Function GetLeafConnection(ByVal categoryId As Integer) As ICalcMapConnection
Sub RegisterCostCollectorCategory(ByVal connection As ICalcMapConnection)
Sub RegisterWBSCategory(ByVal connection As ICalcMapConnection)
Sub RegisterManualCategory(ByVal connection As ICalcMapConnection)
Function GetCostCollectorLeafCategories() As IList(Of ICalcMapConnection)
Function GetWBSLeafCategories() As IList(Of ICalcMapConnection)
Function GetManualCategories() As IList(Of ICalcMapConnection)
Sub AddWbs(ByVal wbsId As Integer)
Function HasWbs(ByVal wbsId As Integer) As Boolean
Sub AddCostCollector(ByVal costCollectorId As Integer)
Function HasCostCollector(ByVal costCollectorId As Integer) As Boolean