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
parameterdescription
TServiceThe service type
methodNameThe name of the expected method invocation.

Exceptions

exceptioncondition
ArgumentNullExceptionWhen the methodName is null.
MissingMethodExceptionThrown when no method with methodName is found.
AmbiguousMatchExceptionThrown 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


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
parameterdescription
TServiceThe service type
TReturnThe return type of the method
methodNameThe name of the expected method invocation.

Exceptions

exceptioncondition
ArgumentNullExceptionWhen the methodName is null.
MissingMethodExceptionThrown when no method with methodName is found.
AmbiguousMatchExceptionThrown 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