Changes between Version 1 and Version 2 of PassThrough
- Timestamp:
- 03/09/08 00:03:42 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PassThrough
v1 v2 39 39 auto mock = new Mocker; 40 40 // And the setup of data. 41 auto associate = mock. Mock!(Associate!(real));41 auto associate = mock.mock!(Associate!(real)); 42 42 real number = 7.23; 43 43 ubyte[] data = new ubyte[4]; 47 47 // the method. However, I want to make sure that ToTest asks about the right 48 48 // number -- this accomplishes that. 49 mock. Expect(associate.isStored(number)).PassThrough;49 mock.expect(associate.isStored(number)).passThrough; 50 50 51 51 // Again, let the existing class deal with it, but this time I don't care 52 52 // about the arguments. 53 53 associate.store(number); 54 mock. LastCall().IgnoreArguments().PassThrough;54 mock.lastCall.ignoreArgs.passThrough; 55 55 56 56 // And yet again. 57 mock. Expect(associate.calculate(data)).PassThrough;57 mock.expect(associate.calculate(data)).passThrough; 58 58 59 59 // And continue with the rest of the test. 60 mock. Replay();60 mock.replay(); 61 61 62 62 auto target = new ToTest(associate); 66 66 // accounting work for them, and made sure they were called the right 67 67 // number of times with the right arguments. 68 mock. Verify();68 mock.verify(); 69 69 } 70 70 }