Interface IPostprocessComposer<T>
Provides statements that can be used to control how specimens are post-processed.
Inherited Members
Namespace: AutoFixture.Dsl
Assembly: AutoFixture.dll
Syntax
public interface IPostprocessComposer<T> : ISpecimenBuilder
Type Parameters
Name | Description |
---|---|
T | The type of specimen. |
Methods
| Improve this Doc View SourceDo(Action<T>)
Performs the specified action on a specimen.
Declaration
IPostprocessComposer<T> Do(Action<T> action)
Parameters
Type | Name | Description |
---|---|---|
System.Action<T> | action | The action to perform. |
Returns
Type | Description |
---|---|
IPostprocessComposer<T> | An IPostprocessComposer<T> which can be used to further customize the post-processing of created specimens. |
OmitAutoProperties()
Disables auto-properties for a type of specimen.
Declaration
IPostprocessComposer<T> OmitAutoProperties()
Returns
Type | Description |
---|---|
IPostprocessComposer<T> | An IPostprocessComposer<T> which can be used to further customize the post-processing of created specimens. |
With<TProperty>(Expression<Func<T, TProperty>>)
Registers that a writable property or field should be assigned an anonymous value as part of specimen post-processing.
Declaration
IPostprocessComposer<T> With<TProperty>(Expression<Func<T, TProperty>> propertyPicker)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T, TProperty>> | propertyPicker | An expression that identifies the property or field that will should have a value assigned. |
Returns
Type | Description |
---|---|
IPostprocessComposer<T> | An IPostprocessComposer<T> which can be used to further customize the post-processing of created specimens. |
Type Parameters
Name | Description |
---|---|
TProperty | The type of the property of field. |
With<TProperty>(Expression<Func<T, TProperty>>, TProperty)
Registers that a writable property or field should be assigned a specific value as part of specimen post-processing.
Declaration
IPostprocessComposer<T> With<TProperty>(Expression<Func<T, TProperty>> propertyPicker, TProperty value)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T, TProperty>> | propertyPicker | An expression that identifies the property or field that will have
|
TProperty | value | The value to assign to the property or field identified by
|
Returns
Type | Description |
---|---|
IPostprocessComposer<T> | An IPostprocessComposer<T> which can be used to further customize the post-processing of created specimens. |
Type Parameters
Name | Description |
---|---|
TProperty | The type of the property of field. |
With<TProperty>(Expression<Func<T, TProperty>>, Func<TProperty>)
Registers that a writable property or field should be assigned generated value as a part of specimen post-processing.
Declaration
IPostprocessComposer<T> With<TProperty>(Expression<Func<T, TProperty>> propertyPicker, Func<TProperty> valueFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T, TProperty>> | propertyPicker | An expression that identifies the property or field that will have |
System.Func<TProperty> | valueFactory | The factory of value to assign to the property or field identified by |
Returns
Type | Description |
---|---|
IPostprocessComposer<T> |
Type Parameters
Name | Description |
---|---|
TProperty |
With<TProperty, TInput>(Expression<Func<T, TProperty>>, Func<TInput, TProperty>)
Registers that a writable property or field should be assigned generated value as a part of specimen post-processing.
Declaration
IPostprocessComposer<T> With<TProperty, TInput>(Expression<Func<T, TProperty>> propertyPicker, Func<TInput, TProperty> valueFactory)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T, TProperty>> | propertyPicker | An expression that identifies the property or field that will have |
System.Func<TInput, TProperty> | valueFactory | The factory of value to assign to the property or field identified by |
Returns
Type | Description |
---|---|
IPostprocessComposer<T> |
Type Parameters
Name | Description |
---|---|
TProperty | |
TInput |
WithAutoProperties()
Enables auto-properties for a type of specimen.
Declaration
IPostprocessComposer<T> WithAutoProperties()
Returns
Type | Description |
---|---|
IPostprocessComposer<T> | An IPostprocessComposer<T> which can be used to further customize the post-processing of created specimens. |
Without<TProperty>(Expression<Func<T, TProperty>>)
Registers that a writable property should not be assigned any automatic value as part of specimen post-processing.
Declaration
IPostprocessComposer<T> Without<TProperty>(Expression<Func<T, TProperty>> propertyPicker)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<T, TProperty>> | propertyPicker | An expression that identifies the property or field to be ignored. |
Returns
Type | Description |
---|---|
IPostprocessComposer<T> | An IPostprocessComposer<T> which can be used to further customize the post-processing of created specimens. |
Type Parameters
Name | Description |
---|---|
TProperty | The type of the property or field to ignore. |