AutoMocker.Use method (1 of 4)
April 20, 2021 · View on GitHub
Adds an instance to the container.
public void Use(Type type, object service)
| parameter | description |
|---|---|
| type | The type of service to use |
| service | The service to use |
See Also
- class AutoMocker
- namespace Moq.AutoMock
AutoMocker.Use<TService> method (2 of 4)
Adds a mock object to the container that implements TService.
public void Use<TService>(Expression<Func<TService, bool>> setup)
where TService : class
| parameter | description |
|---|---|
| TService | The type that the instance will be registered as |
| setup | A shortcut for Mock.Of's syntax |
See Also
- class AutoMocker
- namespace Moq.AutoMock
AutoMocker.Use<TService> method (3 of 4)
Adds an instance to the container.
public void Use<TService>(Mock<TService> mockedService)
where TService : class
| parameter | description |
|---|---|
| TService | The type that the instance will be registered as |
| mockedService | The mocked service |
See Also
- class AutoMocker
- namespace Moq.AutoMock
AutoMocker.Use<TService> method (4 of 4)
Adds an instance to the container.
public void Use<TService>(TService service)
| parameter | description |
|---|---|
| TService | The type that the instance will be registered as |
| service |
See Also
- class AutoMocker
- namespace Moq.AutoMock