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)
parameterdescription
typeThe type of service to use
serviceThe service to use

See Also


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
parameterdescription
TServiceThe type that the instance will be registered as
setupA shortcut for Mock.Of's syntax

See Also


AutoMocker.Use<TService> method (3 of 4)

Adds an instance to the container.

public void Use<TService>(Mock<TService> mockedService)
    where TService : class
parameterdescription
TServiceThe type that the instance will be registered as
mockedServiceThe mocked service

See Also


AutoMocker.Use<TService> method (4 of 4)

Adds an instance to the container.

public void Use<TService>(TService service)
parameterdescription
TServiceThe type that the instance will be registered as
service

See Also