| | | 1 | | using System.Runtime.CompilerServices; |
| | | 2 | | using ArturRios.Configuration.Enums; |
| | | 3 | | |
| | | 4 | | namespace ArturRios.Util.Test.Attributes; |
| | | 5 | | |
| | | 6 | | /// <summary>Marks a unit test fact that can be scoped to specific environments. Stamps the <c>Category=Unit</c> trait.< |
| | | 7 | | /// <param name="environments">Environments in which the test must not run. <c>null</c> imposes no restriction.</param> |
| | | 8 | | /// <param name="skipCondition">When <c>true</c>, the test is skipped regardless of the environment.</param> |
| | | 9 | | /// <param name="sourceFilePath">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 10 | | /// <param name="sourceLineNumber">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 11 | | public class UnitFactAttribute( |
| | | 12 | | EnvironmentType[]? environments = null, |
| | | 13 | | bool skipCondition = false, |
| | | 14 | | [CallerFilePath] string? sourceFilePath = null, |
| | | 15 | | [CallerLineNumber] int sourceLineNumber = -1) |
| | | 16 | | : CustomFactAttribute(TestType.Unit, environments, skipCondition, sourceFilePath, sourceLineNumber); |
| | | 17 | | |
| | | 18 | | /// <summary>Marks a unit test theory that can be scoped to specific environments. Stamps the <c>Category=Unit</c> trait |
| | | 19 | | /// <param name="environments">Environments in which the test must not run. <c>null</c> imposes no restriction.</param> |
| | | 20 | | /// <param name="skipCondition">When <c>true</c>, the test is skipped regardless of the environment.</param> |
| | | 21 | | /// <param name="sourceFilePath">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 22 | | /// <param name="sourceLineNumber">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 23 | | public class UnitTheoryAttribute( |
| | | 24 | | EnvironmentType[]? environments = null, |
| | | 25 | | bool skipCondition = false, |
| | | 26 | | [CallerFilePath] string? sourceFilePath = null, |
| | | 27 | | [CallerLineNumber] int sourceLineNumber = -1) |
| | | 28 | | : CustomTheoryAttribute(TestType.Unit, environments, skipCondition, sourceFilePath, sourceLineNumber); |
| | | 29 | | |
| | | 30 | | /// <summary>Marks a functional test fact that can be scoped to specific environments. Stamps the <c>Category=Functional |
| | | 31 | | /// <param name="environments">Environments in which the test must not run. <c>null</c> imposes no restriction.</param> |
| | | 32 | | /// <param name="skipCondition">When <c>true</c>, the test is skipped regardless of the environment.</param> |
| | | 33 | | /// <param name="sourceFilePath">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 34 | | /// <param name="sourceLineNumber">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 35 | | public class FunctionalFactAttribute( |
| | | 36 | | EnvironmentType[]? environments = null, |
| | | 37 | | bool skipCondition = false, |
| | | 38 | | [CallerFilePath] string? sourceFilePath = null, |
| | | 39 | | [CallerLineNumber] int sourceLineNumber = -1) |
| | 3 | 40 | | : CustomFactAttribute(TestType.Functional, environments, skipCondition, sourceFilePath, sourceLineNumber); |
| | | 41 | | |
| | | 42 | | /// <summary>Marks a functional test theory that can be scoped to specific environments. Stamps the <c>Category=Function |
| | | 43 | | /// <param name="environments">Environments in which the test must not run. <c>null</c> imposes no restriction.</param> |
| | | 44 | | /// <param name="skipCondition">When <c>true</c>, the test is skipped regardless of the environment.</param> |
| | | 45 | | /// <param name="sourceFilePath">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 46 | | /// <param name="sourceLineNumber">Supplied by the compiler; xUnit reports it as the test's source location.</param> |
| | | 47 | | public class FunctionalTheoryAttribute( |
| | | 48 | | EnvironmentType[]? environments = null, |
| | | 49 | | bool skipCondition = false, |
| | | 50 | | [CallerFilePath] string? sourceFilePath = null, |
| | | 51 | | [CallerLineNumber] int sourceLineNumber = -1) |
| | | 52 | | : CustomTheoryAttribute(TestType.Functional, environments, skipCondition, sourceFilePath, sourceLineNumber); |