|
From: Kliment M. <km...@ya...> - 2004-06-30 03:52:05
|
Hi all,
I have an interface that takes ParamArray as parameters, but I can not make DotNetMock mock it up correctly - it throws a verification exception.
Is it a bug or am I doing something wrong?
Thanks, - Kliment
Here is the code:
Private _database As IDatabase ' mock object to emulate DB access
Private _mockDatabase As IMock ' object to control the mock
<Test()> Public Sub DotNetMockFailing()
_mockDatabase = New DynamicMock(GetType(IDatabase))
_database = CType(_mockDatabase.Object, IDatabase)
_mockDatabase.ExpectAndReturn("ExecuteNonQuery", 1, "SQL", 2)
_database.ExecuteNonQuery("SQL", 2) ' verification exception here !!!!
End Sub
Public Interface IDatabase
Function ExecuteNonQuery(ByVal sql As String, ByVal ParamArray params() As Object) As Integer
Function ExecuteScalar(ByVal sql As String, ByVal ParamArray params() As Object) As Object
End Interface
|