From: Nat P. <nat...@b1...> - 2003-04-16 10:12:14
|
Sorry for being incomunicado for the last few days. I haven't had a chance to see the latest changes -- it seems next to impossible to get BT to acknowledge that they can install a phone line to my boat let alone broadband! I'd like the chance to meet up and check out / comment on the latest updates. Are you (Tim) going to be at XTC this week? Perhaps we could hammer out the CallSequence class. > 2) The Callable interface has a "matches" method, this doesn't feel right > for all callables, its required for CallBag to operate - others don't need > it. This should be removed and implemented as a private decoration for > CallBag. For a CallSequence it will also need a "complete" method that returns true if the Callable can be removed from the front of the sequence. Personally, I feel comfortable having these methods in the Callable interface, but if the Decorator approach works that will be great. > 3) Steve's exellent suggestion of having: > > Callable c1 = mock.expect("setContentType".....) > Callable c2 = mock.expect("getWriter".....) > c1.expectBefore(c2) > > has not yet been implemented. This should work quite easily, but the focus > has been on UnorderdMock and OrderedMock. In the new design, this would be accomplished by organising "setContentType" and "getWriter" into a CallSequence and adding the call sequence to the Mock. CallCollection seq = mock.expectSequence(); seq.expectVoid( "setContentType", ... ); seq.expectAndReturn( "getWriter", ... ); The expectBefore method will be quite messy to implement in the current design. Since there is already a way to achieve the same effect, I'd suggest not implementing expectBefore. |