Class FreezingCustomization
Namespace: AutoFixture
Assembly: AutoFixture.dll
A customization that will freeze a specimen of a given Type.
public class FreezingCustomization : ICustomizationInheritance
object ← FreezingCustomization
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors
FreezingCustomization(Type)
Initializes a new instance of the FreezingCustomization class.
public FreezingCustomization(Type targetType)Parameters
targetType Type
The Type to freeze.
Exceptions
targetType is null.
FreezingCustomization(Type, Type)
Initializes a new instance of the FreezingCustomization class.
public FreezingCustomization(Type targetType, Type registeredType)Parameters
targetType Type
The Type to freeze.
registeredType Type
The Type to map the frozen targetType value to.
Exceptions
Either targetType or registeredType is null.
registeredType is not assignable from targetType.
Properties
RegisteredType
Gets the Type to which the frozen TargetType value
should be mapped to. Defaults to the same Type as TargetType.
public Type RegisteredType { get; }Property Value
TargetType
Gets the Type to freeze.
public Type TargetType { get; }Property Value
Methods
Customize(IFixture)
Customizes the fixture by freezing the value of TargetType.
public void Customize(IFixture fixture)Parameters
fixture IFixture
The fixture to customize.
Exceptions
fixture is null.