我有一个函数TryGetValues
接收TKey和ByRef一个TValue,我需要在模拟这个函数时给我一些东西。我需要TValue的值,因为后来在我测试的方法中我将需要它。我用来测试它的方式是:
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)
在这种情况下,我需要连接成为某种东西。我如何用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