Class RhinoMockConstructorMethod

Namespace: AutoFixture.AutoRhinoMock
Assembly: AutoFixture.AutoRhinoMock.dll

Encapsulates how to create a mock instance with Rhino Mocks, using a constructor with appropriate parameters.

public class RhinoMockConstructorMethod : IMethod

Inheritance

objectRhinoMockConstructorMethod

Implements

IMethod

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Remarks

The main purpose of RhinoMockConstructorMethod is to support creation of mock instances of abstract classes with non-default constructors. In this case Rhino Mocks must be supplied with the appropriate parameter values to be able to properly initialize the mock instance, since it needs to pass those parameters to the base class.

Constructors

RhinoMockConstructorMethod(Type, ParameterInfo[])

Initializes a new instance of the RhinoMockConstructorMethod class.

public RhinoMockConstructorMethod(Type mockTargetType, ParameterInfo[] parameterInfos)

Parameters

mockTargetType Type

The type of which a mock instance should be created.

parameterInfos ParameterInfo[]

The parameter information which can be used to identify the signature of the constructor.

Properties

MockTargetType

Gets the type of which a mock instance should be created.

public Type MockTargetType { get; }

Property Value

Type

See Also

RhinoMockConstructorMethod.RhinoMockConstructorMethod(Type, ParameterInfo[])

Parameters

Gets information about the parameters of the method.

public IEnumerable<ParameterInfo> Parameters { get; }

Property Value

IEnumerable<ParameterInfo>

Methods

Invoke(IEnumerable<object>)

Creates a mock instance using Rhino Mocks.

public object Invoke(IEnumerable<object> parameters)

Parameters

parameters IEnumerable<object>

The parameters which will be supplied to the base constructor.

Returns

object

A mock instance created with Rhino Mocks.