I have a function in my VBA code which takes a recordset as an argument and I want to write a test for it without having to access the actual database.
Any ideas on how I would go about this?
Private Function GetAssignData(ByRef rst As DAO.Recordset) As AssignData
'Set up our details
iTeam = 0
iPerson = -1
With rst
ABC_ID = .Fields("ABC Inventory ID")
PROD_OP_ID = .Fields("Prod Op Type ID")
INTEG_OP_ID = .Fields("Integ Issue Type ID")
'
'DO ALL OF OUR REALLY REALLY IMPORTANT LOGIC HERE
'
'Assign Integ Tickets
If .Fields("Ticket Type ID") = 1 Then
iTeam = 2
Else
iTeam = 1
End If
'Assign Prod Ops Tickets
End With
ReturnAssignData:
'And send our final data :D
GetAssignData.iTeam = iTeam
GetAssignData.iPerson = iPerson
End Function