MiniMock

Minimalistic approach to mocking in .NET

View on GitHub

Decision on Supporting Methods

Context

In the MiniMock framework, there is a need to determine the scope of support for mocking methods. Supporting all standard ways of creating methods is essential to ensure the framework’s flexibility and usability. However, there are currently issues with supporting methods that return ref values, which need to be addressed.

Decision

The MiniMock framework will support all standard ways of creating methods. This includes instance methods, static methods, virtual methods, and abstract methods. However, support for methods returning ref values will require additional work and will be addressed in future updates. See issue #5

Methods must be mockable using the following parameters

if none of the above parameters are provided, calling the method must throw a InvalidOperationException with a message in the form “The method ‘[method name]’ in ‘[mocked class]’ is not explicitly mocked.”.

Special cases like [Overloads], [Generic Methods] and [Async Methods] have dedicated ADRs.

Consequences

Positive:

Negative:


More ADRs can be found in the docs/ADR directory.