| Moq1000 |
Usage |
Sealed classes cannot be mocked |
NoSealedClassMocksAnalyzer.cs |
| Moq1001 |
Usage |
Mocked interfaces cannot have constructor parameters |
ConstructorArgumentsShouldMatchAnalyzer.cs |
| Moq1002 |
Usage |
Parameters provided into mock do not match any existing constructors |
ConstructorArgumentsShouldMatchAnalyzer.cs |
| Moq1003 |
Usage |
Internal type requires InternalsVisibleTo for DynamicProxy |
InternalTypeMustHaveInternalsVisibleToAnalyzer.cs |
| Moq1004 |
Usage |
ILogger should not be mocked |
NoMockOfLoggerAnalyzer.cs |
| Moq1100 |
Correctness |
Callback signature must match the signature of the mocked method |
CallbackSignatureShouldMatchMockedMethodAnalyzer.cs |
| Moq1101 |
Correctness |
SetupGet/SetupSet/SetupProperty should be used for properties, not for methods |
NoMethodsInPropertySetupAnalyzer.cs |
| Moq1200 |
Correctness |
Setup should be used only for overridable members |
SetupShouldBeUsedOnlyForOverridableMembersAnalyzer.cs |
| Moq1201 |
Correctness |
Setup of async methods should use .ReturnsAsync instance instead of .Result |
SetupShouldNotIncludeAsyncResultAnalyzer.cs |
| Moq1202 |
Correctness |
Raise event arguments should match the event delegate signature |
RaiseEventArgumentsShouldMatchEventSignatureAnalyzer.cs |
| Moq1203 |
Correctness |
Method setup should specify a return value |
MethodSetupShouldSpecifyReturnValueAnalyzer.cs |
| Moq1204 |
Correctness |
Raises event arguments should match event signature |
RaisesEventArgumentsShouldMatchEventSignatureAnalyzer.cs |
| Moq1205 |
Correctness |
Event setup handler type should match event delegate type |
EventSetupHandlerShouldMatchEventTypeAnalyzer.cs |
| Moq1206 |
Correctness |
Async method setups should use ReturnsAsync instead of Returns with async lambda |
ReturnsAsyncShouldBeUsedForAsyncMethodsAnalyzer.cs |
| Moq1207 |
Correctness |
SetupSequence should be used only for overridable members |
SetupSequenceShouldBeUsedOnlyForOverridableMembersAnalyzer.cs |
| Moq1208 |
Correctness |
Returns() delegate type mismatch on async method setup |
ReturnsDelegateShouldReturnTaskAnalyzer.cs |
| Moq1210 |
Correctness |
Verify should be used only for overridable members |
VerifyShouldBeUsedOnlyForOverridableMembersAnalyzer.cs |
| Moq1300 |
Usage |
Mock.As() should take interfaces only |
AsShouldBeUsedOnlyForInterfaceAnalyzer.cs |
| Moq1301 |
Usage |
Mock.Get() should not take literals |
MockGetShouldNotTakeLiteralsAnalyzer.cs |
| Moq1302 |
Usage |
LINQ to Mocks expression should be valid |
LinqToMocksExpressionShouldBeValidAnalyzer.cs |
| Moq1400 |
Best Practice |
Explicitly choose a mocking behavior instead of relying on the default (Loose) behavior |
SetExplicitMockBehaviorAnalyzer.cs |
| Moq1410 |
Best Practice |
Explicitly set the Strict mocking behavior |
SetStrictMockBehaviorAnalyzer.cs |
| Moq1420 |
Usage |
Redundant Times.AtLeastOnce() specification can be removed |
RedundantTimesSpecificationAnalyzer.cs |
| Moq1500 |
Best Practice |
MockRepository.Verify() should be called |
MockRepositoryVerifyAnalyzer.cs |
| Moq1600 |
Usage |
Protected setup should use ItExpr matchers |
ProtectedSetupShouldUseItExprAnalyzer.cs |