AutoMocker.With method (1 of 4)

June 4, 2021 · View on GitHub

Creates an instance of implementationType and registers it for service type implementationType. This is a convenience method for Use(implementationType, CreateInstance(implementationType))

public void With(Type implementationType)

See Also


AutoMocker.With method (2 of 4)

Creates an instance of implementationType and registers it for service type serviceType. This is a convenience method for Use(serviceType, CreateInstance(implementationType))

public void With(Type serviceType, Type implementationType)

See Also


AutoMocker.With<TImplementation> method (3 of 4)

Creates an instance of TImplementation and registers it as for service type TImplementation. This is a convenience method for Use<TImplementation>(CreateInstance<TImplementation>())

public void With<TImplementation>()
    where TImplementation : class
parameterdescription
TImplementationThe service implementation type

See Also


AutoMocker.With<TService,TImplementation> method (4 of 4)

Creates an instance of TImplementation and registers it as for service type TService. This is a convenience method for Use<TService>(CreateInstance<TImplementation>())

public void With<TService, TImplementation>()
    where TImplementation : class, TService
parameterdescription
TServiceThe service type
TImplementationThe service implementation type

See Also