Interface IPostprocessComposer<T>
Namespace: AutoFixture.Dsl
Assembly: AutoFixture.dll
Provides statements that can be used to control how specimens are post-processed.
public interface IPostprocessComposer<T> : ISpecimenBuilderType Parameters
T
The type of specimen.
Implements
Extension Methods
SpecimenFactory.Create<T>(ISpecimenBuilder), SpecimenFactory.Create<T>(IPostprocessComposer<T>), SpecimenFactory.CreateMany<T>(ISpecimenBuilder), SpecimenFactory.CreateMany<T>(IPostprocessComposer<T>), SpecimenFactory.CreateMany<T>(ISpecimenBuilder, int), SpecimenFactory.CreateMany<T>(IPostprocessComposer<T>, int), SpecimenCommand.Do<T>(ISpecimenBuilder, Action<T>), SpecimenCommand.Do<T1, T2>(ISpecimenBuilder, Action<T1, T2>), SpecimenCommand.Do<T1, T2, T3>(ISpecimenBuilder, Action<T1, T2, T3>), SpecimenCommand.Do<T1, T2, T3, T4>(ISpecimenBuilder, Action<T1, T2, T3, T4>), SpecimenQuery.Get<T, TResult>(ISpecimenBuilder, Func<T, TResult>), SpecimenQuery.Get<T1, T2, TResult>(ISpecimenBuilder, Func<T1, T2, TResult>), SpecimenQuery.Get<T1, T2, T3, TResult>(ISpecimenBuilder, Func<T1, T2, T3, TResult>), SpecimenQuery.Get<T1, T2, T3, T4, TResult>(ISpecimenBuilder, Func<T1, T2, T3, T4, TResult>), CustomizationExtensions.ToCustomization(ISpecimenBuilder)
Methods
Do(Action<T>)
Performs the specified action on a specimen.
IPostprocessComposer<T> Do(Action<T> action)Parameters
action Action<T>
The action to perform.
Returns
An IPostprocessComposer%601 which can be used to further customize the
post-processing of created specimens.
OmitAutoProperties()
Disables auto-properties for a type of specimen.
IPostprocessComposer<T> OmitAutoProperties()Returns
An IPostprocessComposer%601 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.
IPostprocessComposer<T> With<TProperty>(Expression<Func<T, TProperty>> propertyPicker)Parameters
propertyPicker Expression<Func<T, TProperty>>
An expression that identifies the property or field that will should have a value assigned.
Returns
An IPostprocessComposer%601 which can be used to further customize the
post-processing of created specimens.
Type Parameters
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.
IPostprocessComposer<T> With<TProperty>(Expression<Func<T, TProperty>> propertyPicker, TProperty value)Parameters
propertyPicker Expression<Func<T, TProperty>>
An expression that identifies the property or field that will have
value assigned.
value TProperty
The value to assign to the property or field identified by
propertyPicker.
Returns
An IPostprocessComposer%601 which can be used to further customize the
post-processing of created specimens.
Type Parameters
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.
IPostprocessComposer<T> With<TProperty>(Expression<Func<T, TProperty>> propertyPicker, Func<TProperty> valueFactory)Parameters
propertyPicker Expression<Func<T, TProperty>>
An expression that identifies the property or field that will have valueFactory result assigned.
valueFactory Func<TProperty>
The factory of value to assign to the property or field identified by propertyPicker.
Returns
Type Parameters
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.
IPostprocessComposer<T> With<TProperty, TInput>(Expression<Func<T, TProperty>> propertyPicker, Func<TInput, TProperty> valueFactory)Parameters
propertyPicker Expression<Func<T, TProperty>>
An expression that identifies the property or field that will have valueFactory result assigned.
valueFactory Func<TInput, TProperty>
The factory of value to assign to the property or field identified by propertyPicker.
Returns
Type Parameters
TProperty
TInput
With<TProperty>(Expression<Func<T, TProperty>>, ISpecimenBuilder)
Registers that a writable property or field should be assigned generated value as a part of specimen post-processing.
IPostprocessComposer<T> With<TProperty>(Expression<Func<T, TProperty>> propertyPicker, ISpecimenBuilder builder)Parameters
propertyPicker Expression<Func<T, TProperty>>
An expression that identifies the property or field that will have builder result assigned.
builder ISpecimenBuilder
The specimen builder to assign to the property or field identified by propertyPicker.
Returns
An IPostprocessComposer%601 which can be used to further customize the
post-processing of created specimens.
Type Parameters
TProperty
WithAutoProperties()
Enables auto-properties for a type of specimen.
IPostprocessComposer<T> WithAutoProperties()Returns
An IPostprocessComposer%601 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.
IPostprocessComposer<T> Without<TProperty>(Expression<Func<T, TProperty>> propertyPicker)Parameters
propertyPicker Expression<Func<T, TProperty>>
An expression that identifies the property or field to be ignored.
Returns
An IPostprocessComposer%601 which can be used to further customize the
post-processing of created specimens.
Type Parameters
TProperty
The type of the property or field to ignore.