Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 1 and Version 2 of PassThrough

Show
Ignore:
Author:
dhasenan (IP: 130.245.250.80)
Timestamp:
03/09/08 00:03:42 (16 years ago)
Comment:

Updated for the new identifiers in v1

Legend:

Unmodified
Added
Removed
Modified
  • PassThrough

    v1 v2  
    3939      auto mock = new Mocker; 
    4040      // And the setup of data. 
    41       auto associate = mock.Mock!(Associate!(real)); 
     41      auto associate = mock.mock!(Associate!(real)); 
    4242      real number = 7.23; 
    4343      ubyte[] data = new ubyte[4]; 
    4747      // the method. However, I want to make sure that ToTest asks about the right 
    4848      // number -- this accomplishes that. 
    49       mock.Expect(associate.isStored(number)).PassThrough; 
     49      mock.expect(associate.isStored(number)).passThrough; 
    5050 
    5151      // Again, let the existing class deal with it, but this time I don't care 
    5252      // about the arguments. 
    5353      associate.store(number); 
    54       mock.LastCall().IgnoreArguments().PassThrough; 
     54      mock.lastCall.ignoreArgs.passThrough; 
    5555 
    5656      // And yet again. 
    57       mock.Expect(associate.calculate(data)).PassThrough; 
     57      mock.expect(associate.calculate(data)).passThrough; 
    5858 
    5959      // And continue with the rest of the test. 
    60       mock.Replay(); 
     60      mock.replay(); 
    6161 
    6262      auto target = new ToTest(associate); 
    6666      // accounting work for them, and made sure they were called the right 
    6767      // number of times with the right arguments. 
    68       mock.Verify(); 
     68      mock.verify(); 
    6969   } 
    7070}