Class ReadonlyCollectionPropertiesCommand
A command which invokes System.Collections.Generic.ICollection<T>.Add(T) to fill all readonly properties in a specimen that implement System.Collections.Generic.ICollection<T>.
Inheritance
Implements
Inherited Members
Namespace: AutoFixture.Kernel
Assembly: AutoFixture.dll
Syntax
public class ReadonlyCollectionPropertiesCommand : ISpecimenCommand
Constructors
| Improve this Doc View SourceReadonlyCollectionPropertiesCommand()
Constructs an instance of ReadonlyCollectionPropertiesCommand, used to fill all readonly properties in a specimen that implement System.Collections.Generic.ICollection<T>.
Declaration
public ReadonlyCollectionPropertiesCommand()
ReadonlyCollectionPropertiesCommand(IPropertyQuery)
Constructs an instance of ReadonlyCollectionPropertiesCommand, used to fill all readonly properties in a specimen that implement System.Collections.Generic.ICollection<T>.
Declaration
public ReadonlyCollectionPropertiesCommand(IPropertyQuery propertyQuery)
Parameters
Type | Name | Description |
---|---|---|
IPropertyQuery | propertyQuery | The query that will be applied to select readonly collection properties. |
Properties
| Improve this Doc View SourcePropertyQuery
Gets the query used to determine whether or not a specified type has readonly collection properties.
Declaration
public IPropertyQuery PropertyQuery { get; }
Property Value
Type | Description |
---|---|
IPropertyQuery |
Methods
| Improve this Doc View SourceExecute(Object, ISpecimenContext)
Invokes System.Collections.Generic.ICollection<T>.Add(T) to fill all readonly properties in a specimen that implement System.Collections.Generic.ICollection<T>.
Declaration
public void Execute(object specimen, ISpecimenContext context)
Parameters
Type | Name | Description |
---|---|---|
System.Object | specimen | The specimen on which readonly collection properties should be filled. |
ISpecimenContext | context | An ISpecimenContext that is used to create the elements used to fill collections. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |