From: Tim M. <tim...@po...> - 2003-05-13 23:45:37
|
> Ok thanks. Then I don't understand the difference between match*() and > expectAndReturn(). > This appears to be a stumbling block - its exactly what steve said.. but to repeat: expect means: "To consider obligatory; require: e.g. The school expects its pupils to be on time." match means: "One that is like another in one or more specified qualities: He is John's match for bravery." Thus - expectAndReturn means that it is obligatory for a certain call to happen. We specify that call (becuase java does method overloading). And we also specify the result of that call. matchAndReturn means that we just specify a value that is like what would happen if the real call had taken place. Note that we DONT set any expectation. If the call doesn't happen then no failure would happen. In other words, its a return without any expectation, however in Java you cannot create a method called "return(String name, Object return value)" as return is a reserved word. I can't think of any clearer way of saying this - does it help? Tim --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.476 / Virus Database: 273 - Release Date: 24/04/2003 |