From: Tim M. <tim...@po...> - 2003-06-04 12:59:09
|
Dan - something sounds strange there. In the legacy mock stuff the ExpectationValue is used to check input parameters. There is a separate object for results called ReturnObjectList. You probably shouldn't confuse the two. Look at the code that MockMaker generates as guide. However I wonder if you might be better of looking that the dynamic mock stuff - we are mostly using that now and it has the concept of: anObject.expectAndReturn("getTitle", "Charles Dickens", "Great Expectations"); E.g. you can set an expectation and set the return value in one step, which I think is what you are hinting at. Tim > -----Original Message----- > From: moc...@li... > [mailto:moc...@li...]On Behalf Of > Dan Cramer > Sent: 01 June 2003 18:38 > To: Mockobjects-Dev > Subject: [MO-java-dev] Suggested mod to ExpectationValue > > > Hello. I'm new to using mock objects, so, maybe I'm using something > wrong, but I'd like to suggest adding the following to > com.mockobjects.ExpectationValue: > > /** > * Provide access to the expected value for this expectation so > that > * mock objects can return that value to clients. > */ > public Object getExpected() > { > return myExpectedValue; > } > > This would allow a mock to use the expected value to implement its > interface. For example, I have an object that's supposed to have some > properties set on it at one point and then retrieved later in the same > workflow. In order to use expectation value, the way it's currently > written, I find myself having two variables: the expectation and a value > (same thing that's stored in the expectation. > > Comments/Suggestions? Am I doing something wrong? > > Sincerely, > Dan Cramer > > > > ------------------------------------------------------- > This SF.net email is sponsored by: eBay > Get office equipment for less on eBay! > http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 > _______________________________________________ > Mockobjects-java-dev mailing list > Moc...@li... > https://lists.sourceforge.net/lists/listinfo/mockobjects-java-dev > > --- > Incoming mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.487 / Virus Database: 286 - Release Date: 01/06/2003 > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.487 / Virus Database: 286 - Release Date: 01/06/2003 |