AutoMock Class

Summary

Automatically creates fakes for requested services that haven't been registered
Assembly
Rocket.Surgery.Extensions.Testing.Moq.dll
Namespace
Rocket.Surgery.Extensions.Testing
Interfaces
  • IDisposable
Base Types
  • Object
graph BT Type-->Base0["Object"] Type-.->Interface0["IDisposable"] Type["AutoMock"] class Type type-node

Syntax

public sealed class AutoMock : IDisposable

Attributes

Type Description
NullableContextAttribute
NullableAttribute

Constructors

Name Summary
AutoMock(MockBehavior, IContainer, Func<IContainer, IContainer>) Create a container that automatically fakes unknown types
AutoMock(MockRepository, IContainer, Func<IContainer, IContainer>) Create a container that automatically fakes unknown types

Properties

Name Value Summary
Container IContainer
Gets the DryIoc.IContainer that handles the component resolution.

Methods

Name Value Summary
Mock<T>() Mock<T>
Finds (creating if needed) the actual mock for the provided type.
Provide<TService, TImplementation>() TService
Resolve the specified type in the container (register it if needed).
Provide<TService>(TService) TService
Resolve the specified type in the container (register specified instance if needed).
Resolve<T>() T
Resolve the specified type in the container (register it if needed).

Extension Methods

Name Value Summary
SetBackingValue<AutoMock, TV>(Expression<Func<AutoMock, TV>>, TV) T
Sets the backing value.
With<AutoMock, TKey, TField>(Dictionary<TKey, TField>, IDictionary<TKey, TField>) TBuilder
Adds the specified dictionary to the provided dictionary.