Class AutoNSubstituteCustomization
Enables auto-mocking with NSubstitute.
Implements
Inherited Members
Namespace: AutoFixture.AutoNSubstitute
Assembly: AutoFixture.AutoNSubstitute.dll
Syntax
public class AutoNSubstituteCustomization : ICustomization
Remarks
NOTICE! You can assign the customization properties to tweak the features you would like to enable. See example.
new AutoNSubstituteCustomization { ConfigureMembers = true }
Constructors
| Improve this Doc View SourceAutoNSubstituteCustomization()
Initializes a new instance of the AutoNSubstituteCustomization class.
NOTICE! You can assign the customization properties to tweak the features you would like to enable. Example:
new AutoNSubstituteCustomization { ConfigureMembers = true }
Declaration
public AutoNSubstituteCustomization()
AutoNSubstituteCustomization(ISpecimenBuilder)
Initializes a new instance of the AutoNSubstituteCustomization class.
Declaration
[Obsolete("This constructor is obsolete and will be removed in a future version of the product. Please use the AutoNSubstituteCustomization() overload (without arguments) instead and set the Relay property.")]
public AutoNSubstituteCustomization(ISpecimenBuilder relay)
Parameters
Type | Name | Description |
---|---|---|
ISpecimenBuilder | relay |
Properties
| Improve this Doc View SourceBuilder
Gets the builder that will be added to ResidueCollectors when Customize(IFixture) is invoked.
Declaration
[Obsolete("This property is obsolete - use the Relay property instead.")]
public ISpecimenBuilder Builder { get; }
Property Value
Type | Description |
---|---|
ISpecimenBuilder |
ConfigureMembers
Specifies whether members of a substitute will be automatically configured to retrieve the return values from a fixture.
Declaration
public bool ConfigureMembers { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
GenerateDelegates
If value is true
, delegate requests are intercepted and created by NSubstitute.
Otherwise, if value is false
, delegates are created by the AutoFixture kernel.
Declaration
public bool GenerateDelegates { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Relay
Gets or sets the relay that will be added to ResidueCollectors when Customize(IFixture) is invoked.
Declaration
public ISpecimenBuilder Relay { get; set; }
Property Value
Type | Description |
---|---|
ISpecimenBuilder |
Methods
| Improve this Doc View SourceCustomize(IFixture)
Customizes an IFixture to enable auto-mocking with NSubstitute.
Declaration
public void Customize(IFixture fixture)
Parameters
Type | Name | Description |
---|---|---|
IFixture | fixture |