From: Griffin C. <gri...@ma...> - 2004-06-30 12:59:19
|
you know, that's a good question. I am not sure if DynamicMock was ever setup to handle variable length=20 parameters. I will check on this tonight and get back to you tonight or tomorrow. Thanks, 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 |