rjmurillo / moq.analyzers

Set of analyzers for Moq mocking library
BSD 3-Clause "New" or "Revised" License
22 stars 2 forks source link

Reduce test cases by picking a value for MockBehavior #123

Closed rjmurillo closed 1 week ago

rjmurillo commented 1 week ago

Some test cases have multiple MockBehavior values defined, expanding the number of test cases used.

This is

  1. Inconsistent between analyzer tests
  2. Does not change the analyzer behavior

That is, there is no difference between MockBehavior.Default, MockBehavior.Loose, and MockBehavior.Strict. There is a difference between not specifying a mock behavior and specifying a behavior. Tests should have one of each constructor

  1. Default (no args)
  2. Specifying a MockBehavior (e.g., MockBehavior.Default)

Where applicable (e.g., ConstructorArgumentsShouldMatchAnalyzer):

  1. Specifying constructor parameters
  2. Specifying a MockBehavior and also specifying constructor parameters