|
From: <aci...@ac...> - 2007-10-12 19:06:09
|
On Fri, October 12, 2007 12:56 pm, Andrey Shchekin wrote: > On 10/12/07, aci...@ac... <aci...@ac...> wrote: >> On Fri, October 12, 2007 8:55 am, Steve Mitcham wrote: >> Bug #: 1740285 >> Title: NMock don't work with interfaces with visiblity internal >> NMock2?: Yes >> Proposed Resolution: Need more validation, though I don't believe this >> is >> something that should be fixed, as it would bypass the CLR's >> accessibility >> protections, and possibly the original developers intentions. > > Internal interfaces are definitely mockable in .Net 2.0: > http://blog.ashmind.com/index.php/2007/07/07/mocking-internal-interfaces-with-nmock2/ So it is possible, which is nice to know. Your blog post however reinforces my statement that we shouldn't fix the "bug". As a developer you know you are going to be mocking your code and can add the InternalsVisibleTo attribute if you want to. This doesn't work with someone elses code but it doesn't make sense to try and rely on behavior that an outside library has explicitly marked internal. -Richard Holden |