Example:
var mock = new Mock<IDoSomething>(); mock.Setup(x => x.DoSomething());
CA1506 is raised as a warning to Avoid excessive class coupling. This is, obviously, a little strange. Stranger still is that this warning results in a compilation error.
Anyway, it's a bug in Visual Studio. The workaround is just to remove this check from your Code Analysis (goto Project Properties | Code Analysis | Maintainability Rules and uncheck CA1506).
No comments:
Post a Comment