From: Nat P. <nat...@gm...> - 2006-07-17 07:37:05
|
The NMock-2 API has support for indexers: This is how you set up an expectation for an indexer get: Stub.On(indexed).Get["Bill","Gates"].Will(Return.Value("Microsoft")); Stub.On(indexed).Get["Steve","Jobs"].Will(Return.Value("Apple")); This is how you set up an expectation for an indexer set: Expect.Once.On(indexed).Set["Bill","Gates"].To("Microsoft"); The NMock-2 acceptance tests can be used as examples of how to use the API: http://nmock.cvs.sourceforge.net/nmock/nmock2/src/NMock2.AcceptanceTests/ But yes, this information should be in the tutorial and cheat-sheet. --Nat. On 7/17/06, Bill Cohagan <co...@ac...> wrote: > > > > > I figured it out (by looking at the MSIL). You use the method named get_Item > (or set_Item) with the appropriate arguments. > > > > Bill > > > > ________________________________ > > > From: nmo...@li... > [mailto:nmo...@li...] On > Behalf Of Bill Cohagan > Sent: Monday, July 17, 2006 12:23 AM > To: nmo...@li... > Subject: [Nmock-general] Mocking c# Indexer in NMock 2.0? > > > > > I've found the mailing list article on mocking indexers in earlier NMock > versions, but that approach doesn't seem to apply in 2.0. How can I mock > indexers in NMock 2.0? > > > > TIA, > > Bill Cohagan > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > _______________________________________________ > Nmock-general mailing list > Nmo...@li... > https://lists.sourceforge.net/lists/listinfo/nmock-general > > > |