Riley,
You are correct that there is a problem here. See this
Bug in Microsoft
Although you might be able to sign the unit test assembly to solve this. It can be quite confusing as neither assemblies can be built until you get the public key right (See
Oliver Strums Blog)
:idea: The easy way out is to use TypeMocks
concrete mock ability.
Because the interface is internal, a concrete type that implement the interface is defined in the same assembly.
So a good workaround is to mock the real concrete type (that implements this interface).
Here is a small example:
// production code
internal interface InternalInterface
{
...
}
private class ConcreteClass : InternalInterface
{
...
}
The Test
MockObject internalInterfaceMock = MockManager.MockObject(typeof(ConcreteClass));
// make sure the behavior is the same as interfaces
internalInterfaceMock.Strict = true;
InternalInterface theMockedObject = (InternalInterface)internalInterfaceMock.Object