|
From: Jeff M. <je...@mk...> - 2002-05-27 09:27:24
|
The idea is to try and separate the data which is used by the class your
testing and the data created/manipulated by the class your testing.
Also using a list lets you know more about what is actually happening if
the get(String name) did a lookup to return a value you could make the
call 1000 times instead of once an not know about it. If you provide a
list you eventually run out of things in the list to return and the test
fails.
There is now a class called ReturnObjectList which formalizes this
process
ReturnObjectList list = new ReturnObjectList("a list of stuff");
...
list.addObjectToReturn(...);
...
return list.nextObjectToReturn();
MockAttributes should be changed to use this. I'm happy to change it but
since I'm in the middle of an office move committing it to cvs is a
little convoluted.
What should be done is to name the argument to get method an expected
one.
Actually I'll just attach the changes (not in diff format as I can't see
cvs :( ).
What needs to be done though is to
On Wed, 2002-05-22 at 22:29, mark mascolino wrote:
>
> Hello all,
>
> I am relatively new to the world of Mock Objects and have come across your
> implementation. I found a good reason to use the MockAttributes and
> MockAttribute classes and found that the implementations are a bit limiting.
> For example MockAttributes' get(String name) method does not use the name
> parameter at all and returns the first item found in an ArrayList. It also
> removes that item from ArrayList.
>
> I was wondering if this limited implementation was intended (based on some
> Mock Object Philosophy that I am unaware of) or was just choosen because it
> got the job done quickly. If it was the latter, I think I might be
> interested in providing patches if people would find them useful.
>
> thanks in advance...
> mark
>
> _______________________________________________________________
>
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
>
> _______________________________________________
> Mockobjects-java-dev mailing list
> Moc...@li...
> https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev
--
|