|
From: Jim A. <JA...@th...> - 2004-12-17 11:15:41
|
<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2><DIV>I understand now. You really want to set a result on the re=
f parameter. There's no reason why NMock couldn't be changed to allow=
this; I think it's a valid enhancement and I'd like to work on it. M=
aybe if I get some time over the holidays :-)</DIV><DIV> </DIV><DIV>Ji=
m</DIV><DIV> </DIV><DIV>ThoughtWorks<BR></DIV><FONT color=3D#990099>--=
---nmo...@li... wrote: -----<BR><BR></FONT><bl=
ockquote style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">To: Jim Arnold <JArno=
ld...@th...><BR>From: Dominik Fretz <li...@ro...><BR>S=
ent by: nmo...@li...<BR>Date: 12/16/2004 11:02=
PM<BR>cc: nmo...@li...<BR>Subject: Re: [Nmock-genera=
l] Problem with 'ref string[]' parameter<BR><BR>Hi Jim <BR><BR>Thank you fo=
r your fast answer & bug fix! <BR><BR>Probably my test is a bit too con=
structed to display the miss behaivior ... <BR><BR>The concrete problem was=
in a existing project of mine. <BR>There is a given library with a more or=
less simple behavior, Its a database abstraction lib. <BR>There are struct=
s for the rows of a table, and a function to fill a array of this structs f=
or a select statement. <BR>The function, as example 'GetJobsForCustomer' lo=
oks like this: <BR>public bool GetJobsForCustomer(int customerId, ref JobRo=
w[] rows) <BR><BR>Call the function, i have to create a new, but null assin=
ged JobRow array, and pass this by reference. <BR>If the function returned =
true, it successed, and my rows array contains all the JobsRow's for the cu=
stomer. <BR><BR>It tried to create a DynamicMock for this behavior ... but =
it seams that this is a bit out of the probabbilities <BR>of nmock. I think=
i have to implement a mock by myself. <BR><BR>But thank you for fixing the=
bug so fast! <BR><BR>and sorry for the 'mail-adress-mess', i posted the fi=
rst massage over a webmail that was not successfully configured. <BR><BR>Gr=
eethings <BR>Dominik <BR><BR><BR>Jim Arnold wrote: <BLOCKQUOTE cite=3DmidOF=
C8F...@th... ty=
pe=3D"cite"><FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-s=
erif" size=3D2><DIV>Yes, there is a bug, but I'm a little confused by your =
test. NMock will only verify the value of a parameter, not the a=
ctual reference. In your test, you assign the variable 'refStringArr'=
to null, then pass it to your mock. This will fail (assuming the bug=
has been fixed) because NMock is expecting the original value assigned to =
strArr, which was {"a", "b"}. Even if NMock could have compared the r=
eference refStringArr with strArr, however, it still would have failed, bec=
ause they are different references. So I'm not sure what you expect t=
he behavior to be. </DIV><DIV> </DIV><DIV>Anyway, I have fixed the bug, and=
it should make its way onto SourceForge in the next day or so. </DIV><DIV>=
</DIV><DIV>Jim </DIV><DIV> </DIV><DIV>ThoughtWorks <BR></DIV><FONT color=
=3D#990099></FONT></FONT></BLOCKQUOTE><BR></blockquote><br></FONT>=
|