Namespace Metalama.Testing.AspectTesting
This namespaces contains the framework that allows you to test how your custom aspects transform your code. For more information, see Testing the Aspects.
Classes
AspectTestClass
A base class for test classes built using the current framework.
All test methods must be annotated with both [Theory]
and CurrentDirectoryAttribute,
must have a single parameter accepting the relative path of the test file, and must call RunTestAsync(String, String) as their only implementation.
AspectTestFramework
CurrentDirectoryAttribute
An implementation of SyntaxAttribute
that generates test cases from files in the current directory. To be used with [Theory]
.
This attribute will not include subdirectories that contain a file named _Runner.cs
, nor subdirectories that are covered by
another test method of the same class. It also takes into account the metalamaTests.config
file.
CurrentProjectAttribute
An implementation of SyntaxAttribute
that generates test cases from files in the current project. To be used with [Theory]
.
This attribute will not include subdirectories that contain a file named _Runner.cs
.
It also takes into account the metalamaTests.config
file.
DefaultAspectTestClass
The base class for the test suite that is automatically included in user projects.
FileExtensions
List of file extensions used by the test framework.
TestAssemblyReference
Represents a metadata reference. This class is JSON-serializable.
TestDirectoryOptions
Represent the content of the metalamaTests.json
file. This class is JSON-serializable.
TestFrameworkSelector
Implementation of a Xunit test framework for Metalama that falls back to the default XUnit framework if Resharper or Rider is detected.
TestOptions
A set of test options, which can be included in the source text of tests using special comments like // @ReportOutputWarnings
.
This class is JSON-serializable. Another way to define options is to add a file named metalamaTests.json
into the test directory or
any parent directory.
TestOutputNormalizer
TestScenario
Enumerates the scenarios that are simulated for the test, for instance compilation (the Default scenario), applying a code fix, or others.