Options that configure the behavior of a MetalamaTestContext.
Implements
Namespace: Metalama.Testing.UnitTesting
Assembly: Metalama.Testing.UnitTesting.dll
Syntax
public record MetalamaTestContextOptions : IEquatable<MetalamaTestContextOptions>Remarks
Pass an instance of this record to CreateTestContext(MetalamaTestContextOptions?, IAdditionalServiceCollection?, string?, string?) to customize test behavior. Common options include:
<ul><li><xref href="Metalama.Testing.UnitTesting.MetalamaTestContextOptions.Timeout" data-throw-if-not-resolved="false"></xref>: Maximum time before the test's <xref href="Metalama.Testing.UnitTesting.MetalamaTestContext.CancellationToken" data-throw-if-not-resolved="false"></xref> is signaled</li><li><xref href="Metalama.Testing.UnitTesting.MetalamaTestContextOptions.AdditionalAssemblies" data-throw-if-not-resolved="false"></xref>: Assemblies to add as references to compile-time compilation</li><li><xref href="Metalama.Testing.UnitTesting.MetalamaTestContextOptions.AdditionalMetadataReferences" data-throw-if-not-resolved="false"></xref>: References to add to test compilations</li><li><xref href="Metalama.Testing.UnitTesting.MetalamaTestContextOptions.RequireOrderedAspects" data-throw-if-not-resolved="false"></xref>: Whether to require explicit aspect ordering</li></ul></p>
Constructors
| Name | Description |
|---|---|
| MetalamaTestContextOptions() | |
| MetalamaTestContextOptions(MetalamaTestContextOptions) |
Properties
| Name | Description |
|---|---|
| AdditionalAssemblies | Gets the set of assemblies that should be added as references to the compile-time compilation. |
| AdditionalMetadataReferences | Gets the list of references that will be added to compilations created in this context. |
| AllTargetFrameworks | Gets a semicolon-separated list of all target frameworks of the project, for instance |
| CodeFormattingOptions | Gets code formatting options that indicate how the output code should be formatted. |
| CompileTimeAssemblies | |
| Default | Gets the default MetalamaTestContextOptions value. |
| DesignTimeExtensionTypes | |
| EqualityContract | |
| ExtensionTypes | Gets the list of extension types given explicitly as types using Metalama.Framework.Engine.Extensibility.ITestExtensionCollector, typically through the unit test framework. |
| FormatCompileTimeCode | Gets a value indicating whether the compile-time code should be formatted. |
| FormatOutput | Gets a value indicating whether the output code should be formatted. |
| IgnoreUserProfileLicenses | |
| LanguageVersion | Gets the version of the C# language of the project under test, or |
| ProjectName | |
| Properties | Gets the set of MSBuild properties exposed to the tests. |
| RequireOrderedAspects | Gets a value indicating whether an error should be reported if all aspect classes are not strongly ordered. |
| RequiresExclusivity | |
| RunnerServiceProvider | |
| TempPathLength | Gets the number of characters in the temporary directory. This allows to reproduce issues linked to the length of the temp path. |
| TemplateLanguageVersion | Gets the C# version used in the compile-time project. |
| TestPlugInTypes | |
| Timeout | Gets the test timeout period, after which the CancellationToken of the MetalamaTestContext is signalled. |
Methods
| Name | Description |
|---|---|
| Equals(MetalamaTestContextOptions?) | |
| Equals(object?) | |
| GetHashCode() | |
| PrintMembers(StringBuilder) | |
| ToString() |
Operators
| Name | Description |
|---|---|
| operator ==(MetalamaTestContextOptions?, MetalamaTestContextOptions?) | |
| operator !=(MetalamaTestContextOptions?, MetalamaTestContextOptions?) |