From: Francois B. <fbe...@ft...> - 2002-12-23 21:30:23
|
Hello Ewald, Please see embedded comments. On Mon, 23 Dec 2002 21:12:07 +0100, "Ewald Arnold" <mo...@ew...> said: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello, > > I have started really transforming the files and came across some > questions: > > > In AbstractExpectationcollention there is > > - - Object[] ==> similar to C array: int[3] = { 1, 2, 3} ? > Probably replace by std::vector. In Java, all objects are subclasses of a root class: Object. This allows an Object[] array to hold any type of objects in the Java universe. > > - - Enumeration ==> no idea Enumeration is just a kind of iterator. > > - - Iterator ==> similar to C++ iterators ? > Except maybe that c++ iterators don't know anything about their end, > so you need two of them. I do not know C++ iterators, so I do not exactly understand your comment. > > > Why are there ExpectationList, ExpectationMap and ExpectationSet? They > seem to > have the same interface and function though their inheritance tree is > different. In the Java Collections Framework, there are three types of collections: List, Set and Map. Map is a dictionnary-like collection. It holds values indexed by key. List is conceptually like an array, accessed through in index. A Set is a collection which holds only one of each value. For example: Set s = new ...; s.add("a"); s.add("b"); s.add("a"); assertEquals("duplicate values not added", 2, s.size()); List l = new ...; l.add("a"); l.add("b"); l.add("a"); assertEquals("duplicate values added", 3, l.size()); > > > In ExpectationValue::verify() I added a check for expectNothing, taken > from > ExpectationValueDouble, seems to be forgotton. The same for the check for > null which seems to test for an unused/unassigned element. > > if( expectNothing ) { > AssertMo.assertNull( myName + " expected no value", > actualValue ); > } else if( expectedValue != null ) { Maybe the MockObjects framework is missing a test in ExpectationDouble... I'll let someone else check on that. > > cheers > Ewald > <snip /> Bye ! Francois Beausoleil -- http://fastmail.fm - I mean, what is it about a decent email service? |