|
From: Jim A. <JA...@th...> - 2004-01-19 17:43:59
|
Yes, currently NMock allows you to mock classes with empty constructors. You get back a subclass with a real class as its base. What I'm proposing is to remove the limitation on empty constructors by either *not* calling any constructor on the base, or by allowing the user to pass parameters into GetMockInstance() which would be used to construct the base with. Jim |---------+-----------------------------------------> | | "Mike Bresnahan" | | | <mbr...@vi...> | | | Sent by: | | | nmo...@li...| | | ceforge.net | | | | | | | | | 19/01/2004 16:33 | | | | |---------+-----------------------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: <JA...@th...> | | cc: <nmo...@li...> | | Subject: RE: [Nmock-general] Mocking types with constructors | >------------------------------------------------------------------------------------------------------------------------------| I'm still confused. Does the current Nmock allow classes to be mocked? Wouldn't a mock of a class have a mock as a base as well? Are you saying that the mocked class would have the real class as its base? Mike P.S. A cc'ed list under the assumption that you forgot to. > -----Original Message----- > From: Jim Arnold [mailto:JA...@th...] > Sent: Monday, January 19, 2004 4:11 AM > To: mbr...@vi... > Subject: RE: [Nmock-general] Mocking types with constructors > > > > > > > The point is that sometimes the class you're mocking has > non-virtual methods which the class under test needs to call > (or perhaps you've used Ignore on some methods), and if you > don't have a fully constructed base those methods can fail. > It may not be a big deal, but I've run into it before and > thought it was worth discussing. > > Jim ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general |