Is it possible to use Rhino Mocks to mock WindowsImpersonationContext?
I get:
System.MissingMethodException : Can't find a constructor with matching arguments ----> System.MissingMethodException : Constructor on type 'WindowsImpersonationContextProxy04bee852de914d5b8a47d6776edc4cb3'
var windowsImpersonationContext = mockRepository.Stub<WindowsImpersonationContext>();
mockImpersonation.Stub(x => x.ImpersonateUser("username", "domain", "password")).Return(windowsImpersonationContext);
Here is my code I need to mock
public interface IImpersonation
{
WindowsImpersonationContext ImpersonateUser(string sUsername, string sDomain, string sPassword);
}