AutoMocker.SetupWithAny<TService> method (1 of 2)
April 20, 2021 · View on GitHub
Specifies a setup on the mocked type for a call to a void method. All parameters are filled with IsAny according to the parameter's type.
public ISetup<TService> SetupWithAny<TService>(string methodName)
where TService : class
| parameter | description |
|---|---|
| TService | The service type |
| methodName | The name of the expected method invocation. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | When the methodName is null. |
| MissingMethodException | Thrown when no method with methodName is found. |
| AmbiguousMatchException | Thrown when more that one method matches the passed method name. |
Remarks
This may only be used on methods that are not overloaded. This will create the mock when necessary.
See Also
- class AutoMocker
- namespace Moq.AutoMock
AutoMocker.SetupWithAny<TService,TReturn> method (2 of 2)
Specifies a setup on the mocked type for a call to a non-void (value-returning) method. All parameters are filled with IsAny according to the parameter's type.
public ISetup<TService, TReturn> SetupWithAny<TService, TReturn>(string methodName)
where TService : class
| parameter | description |
|---|---|
| TService | The service type |
| TReturn | The return type of the method |
| methodName | The name of the expected method invocation. |
Exceptions
| exception | condition |
|---|---|
| ArgumentNullException | When the methodName is null. |
| MissingMethodException | Thrown when no method with methodName is found. |
| AmbiguousMatchException | Thrown when more that one method matches the passed method name. |
Remarks
This may only be used on methods that are not overloaded. This will create the mock when necessary.
See Also
- class AutoMocker
- namespace Moq.AutoMock