Class Omitter
Issues OmitSpecimen instances if its encapsulated IRequestSpecification is satisfied.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class Omitter : ISpecimenBuilder
Constructors
| Improve this Doc View SourceOmitter()
Initializes a new instance of the Omitter class.
Declaration
public Omitter()
Omitter(IRequestSpecification)
Initializes a new instance of the Omitter class with the supplied IRequestSpecification.
Declaration
public Omitter(IRequestSpecification specification)
Parameters
Type | Name | Description |
---|---|---|
IRequestSpecification | specification | A specification used to control whether or not an OmitSpecimen instance should be issued. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | specification. |
See Also
Properties
| Improve this Doc View SourceSpecification
Gets the specification used to control whether an OmitSpecimen instance should be issued upon request.
Declaration
public IRequestSpecification Specification { get; }
Property Value
Type | Description |
---|---|
IRequestSpecification |
Remarks
If the constructor overload that takes an IRequestSpecification as input was used, this property returns that instance.
See Also
Methods
| Improve this Doc View SourceCreate(Object, ISpecimenContext)
Creates a new specimen based on a request.
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. |
Returns
Type | Description |
---|---|
System.Object | An OmitSpecimen instance if Specification allows it; otherwise a NoSpecimen instance. |
Remarks
The request
can be any object, but will often be a
System.Type or other System.Reflection.MemberInfo instances.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | request. |