Open sandboxFocus

Class CurrentProjectAttribute

An xUnit data attribute that generates test cases from all snapshot test files in the current project.

Inheritance
DataAttribute
CurrentProjectAttribute
Namespace: Metalama.Testing.AspectTesting
Assembly: Metalama.Testing.AspectTesting.dll
Syntax
[Obsolete("This class is obsolete. Use the default snapshot test project setup provided by Metalama.Testing.AspectTesting instead.")]
public sealed class CurrentProjectAttribute : DataAttribute
Remarks

Use this attribute with [Theory] to automatically discover all test files (*.cs) in the project and generate a test case for each file. Unlike CurrentDirectoryAttribute, this attribute discovers files across the entire project rather than a specific directory.

The attribute excludes:

  • Subdirectories that contain a file named _Runner.cs (which indicates a separate test class)
  • Files marked with // @Skipped directive

Test discovery respects options from metalamaTests.json configuration files.

Constructors

Name Description
CurrentProjectAttribute()

Methods

Name Description
GetData(MethodInfo)

Returns the data to be used to test the theory.

Extension Methods

See Also