We have CruiseControl set up to run tests and deploy our solution. The test are run without problem under admin priviliges, but we have special account for cruise control (not admin) and tests are failed under this account.
Here is the code:
private void MyTestGenerinc<Service>() where Service : IService, new()
{
Mock serviceMock = MockManager.MockAll(typeof(Service));
....
}
It failes inside MockAll method.
The exception mesasage is:
Unhandled Exception: System.Security.SecurityException: Requested registry access is not allowed.
at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable)
at aj.a(Boolean A_0)
at aj.e()
at TypeMock.MockManager.c(Type A_0)
at TypeMock.MockManager.MockAll(Type type, Constructor mockConstructors)
Please, note that tests works fine if we give admin rights to cruise control user.