Class InlineAutoDataAttribute

Namespace: AutoFixture.NUnit3
Assembly: AutoFixture.NUnit3.dll

This attribute acts as a TestCaseAttribute but allow incomplete parameter values, which will be provided by AutoFixture.

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
[CLSCompliant(false)]
public class InlineAutoDataAttribute : Attribute, ITestBuilder

Inheritance

objectAttributeInlineAutoDataAttribute

Implements

ITestBuilder

Inherited Members

Attribute.GetCustomAttributes(MemberInfo, Type), Attribute.GetCustomAttributes(MemberInfo, Type, bool), Attribute.GetCustomAttributes(MemberInfo), Attribute.GetCustomAttributes(MemberInfo, bool), Attribute.IsDefined(MemberInfo, Type), Attribute.IsDefined(MemberInfo, Type, bool), Attribute.GetCustomAttribute(MemberInfo, Type), Attribute.GetCustomAttribute(MemberInfo, Type, bool), Attribute.GetCustomAttributes(ParameterInfo), Attribute.GetCustomAttributes(ParameterInfo, Type), Attribute.GetCustomAttributes(ParameterInfo, Type, bool), Attribute.GetCustomAttributes(ParameterInfo, bool), Attribute.IsDefined(ParameterInfo, Type), Attribute.IsDefined(ParameterInfo, Type, bool), Attribute.GetCustomAttribute(ParameterInfo, Type), Attribute.GetCustomAttribute(ParameterInfo, Type, bool), Attribute.GetCustomAttributes(Module, Type), Attribute.GetCustomAttributes(Module), Attribute.GetCustomAttributes(Module, bool), Attribute.GetCustomAttributes(Module, Type, bool), Attribute.IsDefined(Module, Type), Attribute.IsDefined(Module, Type, bool), Attribute.GetCustomAttribute(Module, Type), Attribute.GetCustomAttribute(Module, Type, bool), Attribute.GetCustomAttributes(Assembly, Type), Attribute.GetCustomAttributes(Assembly, Type, bool), Attribute.GetCustomAttributes(Assembly), Attribute.GetCustomAttributes(Assembly, bool), Attribute.IsDefined(Assembly, Type), Attribute.IsDefined(Assembly, Type, bool), Attribute.GetCustomAttribute(Assembly, Type), Attribute.GetCustomAttribute(Assembly, Type, bool), Attribute.Equals(object?), Attribute.GetHashCode(), Attribute.Match(object?), Attribute.IsDefaultAttribute(), Attribute.TypeId, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

InlineAutoDataAttribute(params object[])

Construct a InlineAutoDataAttribute with parameter values for test method.

public InlineAutoDataAttribute(params object[] arguments)

Parameters

arguments object[]

InlineAutoDataAttribute(IFixture, params object[])

Construct a InlineAutoDataAttribute with an IFixture and parameter values for test method.

[Obsolete("This constructor overload is deprecated because it offers poor performance, and will be removed in a future version. Please use the overload with a factory method, so fixture will be constructed only if needed.")]
protected InlineAutoDataAttribute(IFixture fixture, params object[] arguments)

Parameters

fixture IFixture

arguments object[]

InlineAutoDataAttribute(Func<IFixture>, params object[])

Initializes a new instance of the AutoDataAttribute class with the supplied fixtureFactory. Fixture will be created on demand using the provided factory.

protected InlineAutoDataAttribute(Func<IFixture> fixtureFactory, params object[] arguments)

Parameters

fixtureFactory Func<IFixture>

arguments object[]

Properties

Arguments

Gets the parameter values for the test method.

public IEnumerable<object> Arguments { get; }

Property Value

IEnumerable<object>

TestMethodBuilder

Gets or sets the current ITestMethodBuilder strategy.

public ITestMethodBuilder TestMethodBuilder { get; set; }

Property Value

ITestMethodBuilder

Methods

BuildFrom(IMethodInfo, Test)

Construct one or more TestMethods from a given MethodInfo, using available parameter data.

public IEnumerable<TestMethod> BuildFrom(IMethodInfo method, Test suite)

Parameters

method IMethodInfo

The MethodInfo for which tests are to be constructed.

suite Test

The suite to which the tests will be added.

Returns

IEnumerable<TestMethod>

One or more TestMethods.