|
From: Jim A. <JA...@th...> - 2004-08-26 11:59:12
|
As far as I know this can't be done with the current framework. The problem is that internal types don't have visibility outside their enclosing type or assembly, and as NMock creates a new assembly for its dynamic mocks we can't inherit from them. Jim "Alexey Kalinichenko" <ak...@ho...> Sent by: nmo...@li... 26/08/2004 02:41 To nmo...@li... cc Subject [Nmock-general] NMock and private/internal classes Hi All, I am new to NMock and have a basic question. Is mocking private/internal class supported by NMock? It doesn't work for me, I get MemberAccessException for the class ctor. I looked at the code and as far as I understand the mock class is created in a dynamic assembly and derived from the specified class. So in order for this to work the mocked class needs to be public. Is there any way around it? What is the preferred method of mocking private classes using NMock? Thanks, Alexey ------------------------------------------------------- SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 _______________________________________________ Nmock-general mailing list Nmo...@li... https://lists.sourceforge.net/lists/listinfo/nmock-general |