This project is read-only.


Make client functions overridable


Besides being useful for extensibility, many mocking frameworks require that functions be overridable.
An example from Moq:
User fakeUser = new User();
Mock<StackOverflowClient> mockClient = new Mock<StackOverflowClient>();
mockClient.Expect<User>(c => c.GetUser(userId)).Returns(fakeUser);

file attachments

Closed May 23, 2010 at 5:11 AM by lfoust


lfoust wrote May 22, 2010 at 5:35 PM

Thank you for your patch. Can you please submit it as a svn patch file so I can more easily distinguish what is changed from what is not. No need to submit items you have not changed. Thanks!

ithi wrote May 23, 2010 at 4:26 AM

Appologies. Here's the patch file.

wrote May 23, 2010 at 4:26 AM

lfoust wrote May 23, 2010 at 5:04 AM

Thanks, I'll review the patch tonight. Just curious - besides mocking what are other scenarios you plan on overriding these methods?

wrote May 23, 2010 at 5:11 AM

Resolved with changeset 48562.

wrote Feb 13, 2013 at 6:38 PM

wrote May 16, 2013 at 12:08 AM