Table of Contents

Class ProjectFileDataAttribute

Namespace
Songhay.Tests
Assembly
SonghayCore.xUnit.dll

Defines a custom Xunit.Sdk.DataAttribute for loading FileInfo test-method arguments.

public class ProjectFileDataAttribute : DataAttribute
Inheritance
DataAttribute
ProjectFileDataAttribute
Inherited Members
DataAttribute.Skip
Extension Methods

Constructors

ProjectFileDataAttribute(object[], params string[])

Initializes a new instance of the ProjectFileDataAttribute class.

public ProjectFileDataAttribute(object[] inlineData, params string[] relativePaths)

Parameters

inlineData object[]

The inline data of Xunit.InlineDataAttribute conventions.

relativePaths string[]

The relative paths, mapping to FileInfo test-method arguments.

Remarks

Each relative path maps to a FileInfo argument that must be specified in the test method. Each path is relative to assembly location of the typeInAssembly. For detail, see [ https://github.com/BryanWilhite/SonghayCore/blob/main/SonghayCore.Tests/ProjectFileDataAttributeTests.cs ]

The order of elements in inlineData must have the order of args. So new object[] { 1, "two" } must have int one, string two,.

ProjectFileDataAttribute(params string[])

Initializes a new instance of the ProjectFileDataAttribute class.

public ProjectFileDataAttribute(params string[] relativePaths)

Parameters

relativePaths string[]

The relative paths, mapping to FileInfo test-method arguments.

Remarks

Each relative path maps to a FileInfo argument that must be specified in the test method. Each path is relative to assembly location of the typeInAssembly. For detail, see [ https://github.com/BryanWilhite/SonghayCore/blob/main/SonghayCore.Tests/ProjectFileDataAttributeTests.cs ]

ProjectFileDataAttribute(Type?, object[], params string[])

Initializes a new instance of the ProjectFileDataAttribute class.

public ProjectFileDataAttribute(Type? typeInAssembly, object[] inlineData, params string[] relativePaths)

Parameters

typeInAssembly Type

The type in assembly.

inlineData object[]

The inline data of Xunit.InlineDataAttribute conventions.

relativePaths string[]

The relative paths, mapping to FileInfo test-method arguments.

Remarks

Each relative path maps to a FileInfo argument that must be specified in the test method. Each path is relative to assembly location of the typeInAssembly. For detail, see [ https://github.com/BryanWilhite/SonghayCore/blob/main/SonghayCore.Tests/ProjectFileDataAttributeTests.cs ]

The order of elements in inlineData must have the order of args. So new object[] { 1, "two" } must have int one, string two,.

ProjectFileDataAttribute(Type?, params string[])

Initializes a new instance of the ProjectFileDataAttribute class.

public ProjectFileDataAttribute(Type? typeInAssembly, params string[] relativePaths)

Parameters

typeInAssembly Type

The type in assembly.

relativePaths string[]

The relative paths, mapping to FileInfo test-method arguments.

Remarks

Each relative path maps to a FileInfo argument that must be specified in the test method. Each path is relative to assembly location of the typeInAssembly. For detail, see [ https://github.com/BryanWilhite/SonghayCore/blob/main/SonghayCore.Tests/ProjectFileDataAttributeTests.cs ]

Methods

GetData(MethodInfo)

Returns the data to be used to test the theory.

public override IEnumerable<object[]> GetData(MethodInfo testMethod)

Parameters

testMethod MethodInfo

The method that is being tested

Returns

IEnumerable<object[]>

One or more sets of theory data. Each invocation of the test method is represented by a single object array.