|
From: Griffin C. <gri...@ma...> - 2004-07-23 21:57:41
|
This is fixed in CVS and will be included in the 0.7.0 release.
Just make sure to set your expectation correctly:
expectAndReturn( return, param1, new string[] { param2, param3} )
For example.
-Griffin
On Jun 29, 2004, at 10:51 PM, Kliment Mamykin wrote:
> Hi all,
> I have an interface that takes ParamArray as parameters, but I can not=20=
> make DotNetMock mock it up correctly - it throws a verification=20
> exception.
> Is it a bug or=A0am 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 =3D New DynamicMock(GetType(IDatabase))
> _database =3D 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=20
> params() As Object) As Integer
> Function ExecuteScalar(ByVal sql As String, ByVal ParamArray params()=20=
> As Object) As Object
> End Interface
|