Skip to content

Commit

Permalink
Added TestSubjectAttribute
Browse files Browse the repository at this point in the history
  • Loading branch information
estrizhok committed Apr 18, 2023
1 parent 34b8ba0 commit 9bda498
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/Annotations.cs
Expand Up @@ -1835,4 +1835,35 @@ public sealed class XamlOneWayBindingModeByDefaultAttribute : Attribute { }
public sealed class XamlTwoWayBindingModeByDefaultAttribute : Attribute { }

#endregion

#region Unit Testing

/// <summary>
/// Specifies the subject being tested by a test class or a test method.
/// </summary>
/// <remarks>
/// The <see cref="TestSubjectAttribute"/> can be applied to a test class or a test method to indicate what class
/// or interface the tests defined in them test. This information can be used by an IDE to provide better navigation
/// support or by test runners to group tests by subject and to provide better test reports.
/// </remarks>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = true)]
[Conditional("JETBRAINS_ANNOTATIONS")]
public sealed class TestSubjectAttribute : Attribute
{
/// <summary>
/// Gets the type of the subject being tested.
/// </summary>
[NotNull] public Type Subject { get; }

/// <summary>
/// Initializes a new instance of the <see cref="TestSubjectAttribute"/> class with the specified subject type.
/// </summary>
/// <param name="subject">The type of the subject being tested.</param>
public TestSubjectAttribute([NotNull] Type subject)
{
Subject = subject;
}
}

#endregion
}

0 comments on commit 9bda498

Please sign in to comment.