Class NoSpecimen
Signifies that it's not a specimen.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class NoSpecimen : IEquatable<NoSpecimen>
Remarks
ISpecimenBuilder implementations are expected to return NoSpecimen instances if they can't handle the request. This ensures that null can be used as a proper return value.
Constructors
| Improve this Doc View SourceNoSpecimen()
Initializes a new instance of the NoSpecimen class with a null request.
Declaration
public NoSpecimen()
NoSpecimen(Object)
Initializes a new instance of the NoSpecimen class with the supplied request.
Declaration
[Obsolete("Use NoSpecimen() instead of NoSpecimen(object). The Request property, and this constructor that populates it, is being retired in future versions of AutoFixture, as it has turned out that no one uses it. You can still use the parameterless NoSpecimen constructor overload. The NoSpecimen class itself will remain. If you're seeing this warning in AutoFixture 3.x, and, despite expectations, have a real need to use the Request property, please provide feedback on https://github.com/AutoFixture/AutoFixture/issues/475 .", true)]
public NoSpecimen(object request)
Parameters
Type | Name | Description |
---|---|---|
System.Object | request | The original request that prompts the creation of this instance. |
Properties
| Improve this Doc View SourceRequest
Gets the original request that prompted the creation of the current instance.
Declaration
[Obsolete("The Request property is being retired in future versions of AutoFixture, as it has turned out that no one uses it. If you're seeing this warning in AutoFixture 3.x, and, despite expectations, have a real need to use the Request property, please provide feedback on https://github.com/AutoFixture/AutoFixture/issues/475.", true)]
public object Request { get; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
This property value may be null.
Methods
| Improve this Doc View SourceEquals(NoSpecimen)
Indicates whether the current instance is equal to another NoSpecimen instance.
Declaration
public bool Equals(NoSpecimen other)
Parameters
Type | Name | Description |
---|---|---|
NoSpecimen | other | A NoSpecimen instance to compare with this instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the current instance is equal to the |
Equals(Object)
Determines whether the specified System.Object is equal to the current NoSpecimen instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare to the current instance. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified System.Object is equal to the current instance; otherwise, false. |
Overrides
GetHashCode()
Serves as a hash function for the NoSpecimen class.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current NoSpecimen instance. |