You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Context: OS: Windows 10 Version 10.0.16299 Build 16299 .Net Project Version: 4.6.1 Visual Studio Version: Microsoft Visual Studio Professional 2017 Version 15.5.5 Visual Studio Project Type: MSTest/ClassLibrary Installed Moq Nuget Version: 4.8.1
Expected Behavior:
Create a mock of a custom class named RedisConfiguration without having the object property on the mock property throw an exception.
Steps For Reproducing Behavior
Create a new MSTest project with the custom class RedisConfiguration defined as in the RedisConfiguration.txt
RedisConfiguration's constructors are parameterized, so you need to pass the ctor arguments via new Mock<RedisConfiguration>(argsForRedisConfigurationCtor). You couldn't do new RedisConfiguration() either, right? ;-)
Context:
OS: Windows 10 Version 10.0.16299 Build 16299
.Net Project Version: 4.6.1
Visual Studio Version: Microsoft Visual Studio Professional 2017 Version 15.5.5
Visual Studio Project Type: MSTest/ClassLibrary
Installed Moq Nuget Version: 4.8.1
Expected Behavior:
Create a mock of a custom class named RedisConfiguration without having the object property on the mock property throw an exception.
Steps For Reproducing Behavior
Create a new MSTest project with the custom class RedisConfiguration defined as in the RedisConfiguration.txt
The test project should look like
KeyLoggingConsumerService.txt
Set a breakpoint on the line right after the statement:
RedisConfigurationMock = new Mock<RedisConfiguration>();
Debug the test. Navigate to the the Object property on the RedisConfigurationMock instance.
Observe the error that is thrown. It should be Castle.DynamicProxy.InvalidProxyConstructorArgumentsException
The text was updated successfully, but these errors were encountered: