|
From: David Webster-J. <da...@pi...> - 2006-08-23 08:15:46
|
Sorry I've not been back to you.
There only appear to be two forms of the attribute according to MSDN.
One with a public key (both assemblies must be signed) and one without
the key (when neither is signed).
Neither can be coerced into solving the problem.
Thanks
-----Original Message-----
From: nmo...@li...
[mailto:nmo...@li...] On Behalf Of Steve
Mitcham
Sent: 18 August 2006 15:31
To: NMock2 Development Discussion
Subject: Re: [NMock2-Dev] Access is denied on internal interfaces?
You need to add the fully qualified signed assembly name with the
version and public key token to make it work. Don't know what that is
off the top of my head.
_____
From: nmo...@li...
[mailto:nmo...@li...] On Behalf Of David
Webster-Jaggard
Sent: Friday, August 18, 2006 8:41 AM
To: 'NMock2 Development Discussion'
Subject: Re: [NMock2-Dev] Access is denied on internal interfaces?
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 <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.
|