|
From: David Webster-J. <da...@pi...> - 2006-08-18 13:41:50
|
Wow you're up early! :-)
I added this line to the test project to make NMock2 a friend
[assembly: InternalsVisibleTo("NMock2")]
It didn't help although it seems like it should. Any idea why not?
Thanks
-----Original Message-----
From: nmo...@li...
[mailto:nmo...@li...] On Behalf Of Steve
Mitcham
Sent: 18 August 2006 14:23
To: NMock2 Development Discussion
Subject: Re: [NMock2-Dev] Access is denied on internal interfaces?
Making Nmock2 a friend assembly would work. You could also have a
conditional compilation flag that made them public when built for
testing purposes. However, I think the value of testing internal
interfaces directly is limited.
_____
From: nmo...@li...
[mailto:nmo...@li...] On Behalf Of David
Webster-Jaggard
Sent: Friday, August 18, 2006 8:09 AM
To: nmo...@li...
Subject: [NMock2-Dev] Access is denied on internal interfaces?
I'm upgrading our unit tests to NMock2 and have come across a bit of a
problem. If I try to mock and internal interface I get an access denied
error when I run the test. Here is some example code:
using NMock2;
using NUnit.Framework;
namespace NMock2Test
{
internal interface IInternalInterface
{
void DoNothing();
}
[TestFixture]
public class Class1
{
[Test]
public void Test()
{
Mockery mocks = new Mockery();
IInternalInterface mockInterface =
mocks.NewMock<IInternalInterface>();
}
}
}
Is there anyway to get around this (maybe make NMock2 a friend assembly,
however you do that..)? I don't want to start making internal interfaces
public.
Thanks
--
This message has been scanned for viruses and
dangerous content by <http://www.mailscanner.info/> MailScanner, and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by <http://www.mailscanner.info/> MailScanner, and is
believed to be clean.
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
|