|
From: Dominik F. <li...@ro...> - 2004-12-16 23:10:23
|
Hi Jim
Thank you for your fast answer & bug fix!
Probably my test is a bit too constructed to display the miss behaivior ...
The concrete problem was in a existing project of mine.
There is a given library with a more or less simple behavior, Its a
database abstraction lib.
There are structs for the rows of a table, and a function to fill a
array of this structs for a select statement.
The function, as example 'GetJobsForCustomer' looks like this:
public bool GetJobsForCustomer(int customerId, ref JobRow[] rows)
Call the function, i have to create a new, but null assinged JobRow
array, and pass this by reference.
If the function returned true, it successed, and my rows array contains
all the JobsRow's for the customer.
It tried to create a DynamicMock for this behavior ... but it seams that
this is a bit out of the probabbilities
of nmock. I think i have to implement a mock by myself.
But thank you for fixing the bug so fast!
and sorry for the 'mail-adress-mess', i posted the first massage over a
webmail that was not successfully configured.
Greethings
Dominik
Jim Arnold wrote:
> 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 actual 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
> reference refStringArr with strArr, however, it still would have
> failed, because they are different references. So I'm not sure what
> you expect the behavior to be.
>
> Anyway, I have fixed the bug, and it should make its way onto
> SourceForge in the next day or so.
>
> Jim
>
> ThoughtWorks
|