AutoMocker.Get method (1 of 4)
April 20, 2021 · View on GitHub
Searches and retrieves an object from the container that matches the serviceType. This can be a service setup explicitly via .Use() or implicitly with .CreateInstance().
public object Get(Type serviceType)
| parameter | description |
|---|---|
| serviceType | The type of service to retrieve |
See Also
- class AutoMocker
- namespace Moq.AutoMock
AutoMocker.Get method (2 of 4)
Searches and retrieves an object from the container that matches the serviceType. This can be a service setup explicitly via .Use() or implicitly with .CreateInstance().
public object Get(Type serviceType, bool enablePrivate)
| parameter | description |
|---|---|
| serviceType | The type of service to retrieve |
| enablePrivate | When true, non-public constructors will also be used to create mocks. |
See Also
- class AutoMocker
- namespace Moq.AutoMock
AutoMocker.Get<TService> method (3 of 4)
Searches and retrieves an object from the container that matches TService. This can be a service setup explicitly via .Use() or implicitly with .CreateInstance().
public TService Get<TService>()
where TService : class
| parameter | description |
|---|---|
| TService | The class or interface to search on |
Return Value
The object that implements TService
See Also
- class AutoMocker
- namespace Moq.AutoMock
AutoMocker.Get<TService> method (4 of 4)
Searches and retrieves an object from the container that matches TService. This can be a service setup explicitly via .Use() or implicitly with .CreateInstance().
public TService Get<TService>(bool enablePrivate)
where TService : class
| parameter | description |
|---|---|
| TService | The class or interface to search on |
| enablePrivate | When true, non-public constructors will also be used to create mocks. |
Return Value
The object that implements TService
See Also
- class AutoMocker
- namespace Moq.AutoMock