Class OmitSpecimen
A signal type used to indicate to the Auto-Property feature that a given request should be ignored, and no further processing performed.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class OmitSpecimen : IEquatable<OmitSpecimen>
Remarks
This signal type is different from NoSpecimen in that it stops further processing. Where NoSpecimen is simply an indication that a particular ISpecimenBuilder can't provide a value for a request, an OmitSpecimen instance explicitly indicates that no value will be provided for a request - not even null.
The OmitSpecimen type is explicitly understood by AutoPropertiesCommand, but can be returned by any ISpecimenBuilder.
Methods
| Improve this Doc View SourceEquals(OmitSpecimen)
Determines whether the specified OmitSpecimen instance is equal to the current instance.
Declaration
public bool Equals(OmitSpecimen other)
Parameters
Type | Name | Description |
---|---|---|
OmitSpecimen | other | The other instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
Remarks
It may seem a little strange that any OmitSpecimen instance is equal to any other instance of that type, but the class is a pure signal type that carries no state, so there's no reason to distinguish between instances. In essence, it could just as well have been modeled as a Singleton, but wasn't because it seems to bring no particular extra benefit.
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified System.Object is an instance of OmitSpecimen; otherwise, false. |
Overrides
See Also
| Improve this Doc View SourceGetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |