Class MutableValueTypeWarningThrower
Throws an ObjectCreationException when one tries to create Structure without explicit parametrized constructor. Possibly notifying about bad design (mutable value type).
Inheritance
System.Object
MutableValueTypeWarningThrower
Implements
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class MutableValueTypeWarningThrower : ISpecimenBuilder
Remarks
This ISpecimenBuilder can be used with proper filtering IRequestSpecification to throw exceptions only on structures without constructors. Will throw an exception instead of letting the containing builder return a NoSpecimen instance when it can't satisfy a request or generic exception being thrown.
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Throws an ObjectCreationException.
Declaration
public object Create(object request, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The request that describes what to create. |
ISpecimenContext | context | A context that can be used to create other specimens. Not used. |
Returns
Type | Description |
---|---|
System.Object | This method never returns. It always throws an ObjectCreationException. |