Search Results for

    Show / Hide Table of Contents

    Class WindowsFactAttribute

    This custom XUnit Fact attribute will skip unit tests if the run-time environment is not windows

    Note that the original Skip property takes precedence over this attribute, any unit tests with WindowsFactAttribute with its Skip property set will always be skipped, regardless of the environment variable content.

    Inheritance
    object
    Attribute
    WindowsFactAttribute
    Implements
    IFactAttribute
    Inherited Members
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Akka.TestKit.Xunit.Attributes
    Assembly: Akka.TestKit.Xunit.dll
    Syntax
    public class WindowsFactAttribute : Attribute, IFactAttribute

    Properties

    | Edit this page View Source

    DisplayName

    Gets the name of the test to be used when the test is skipped. When null is returned, will cause a default display name to be used.

    Declaration
    public string? DisplayName { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Explicit

    Gets a flag which indicates whether the test should only be run explicitly. An explicit test is skipped by default unless explicit tests are requested to be run.

    Declaration
    public bool Explicit { get; set; }
    Property Value
    Type Description
    bool
    | Edit this page View Source

    Skip

    Gets the skip reason for the test. When null is returned, the test is not skipped.

    Declaration
    public string? Skip { get; set; }
    Property Value
    Type Description
    string
    Remarks

    Skipping is conditional based on whether Xunit.v3.IFactAttribute.SkipWhen or Xunit.v3.IFactAttribute.SkipUnless is set.

    | Edit this page View Source

    SkipExceptions

    Gets exceptions that, when thrown, will cause the test to be skipped rather than failed.

    Declaration
    public Type[]? SkipExceptions { get; set; }
    Property Value
    Type Description
    Type[]
    Remarks

    The skip reason will be the exception's message.

    | Edit this page View Source

    SkipType

    Gets the type to retrieve Xunit.v3.IFactAttribute.SkipUnless or Xunit.v3.IFactAttribute.SkipWhen from. If not set, then the property will be retrieved from the unit test class.

    Declaration
    public Type? SkipType { get; set; }
    Property Value
    Type Description
    Type
    | Edit this page View Source

    SkipUnix

    The reason why this unit test is being skipped by the WindowsFactAttribute. Note that the original Skip property takes precedence over this message.

    Declaration
    public string? SkipUnix { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    SkipUnless

    Gets the name of a public static property on the test class which returns bool to indicate whether the test should be skipped (false) or not (true).

    Declaration
    public string? SkipUnless { get; set; }
    Property Value
    Type Description
    string
    Remarks

    This property cannot be set if Xunit.v3.IFactAttribute.SkipWhen is set. Setting both will result in a failed test. To ensure compile-time safety and easier refactoring, use the nameof operator, e.g., SkipUnless = nameof(IsConditionMet).

    | Edit this page View Source

    SkipWhen

    Gets the name of a public static property on the test class which returns bool to indicate whether the test should be skipped (true) or not (false).

    Declaration
    public string? SkipWhen { get; set; }
    Property Value
    Type Description
    string
    Remarks

    This property cannot be set if Xunit.v3.IFactAttribute.SkipUnless is set. Setting both will result in a failed test. To avoid issues during refactoring, it is recommended to use the nameof operator to reference the property, e.g., SkipWhen = nameof(IsTestSkipped).

    | Edit this page View Source

    Timeout

    Gets the timeout for test (in milliseconds). When 0 is returned, the test will not have a timeout.

    Declaration
    public int Timeout { get; set; }
    Property Value
    Type Description
    int
    Remarks

    WARNING: Using this with Xunit.Sdk.ParallelAlgorithm.Aggressive will result in undefined behavior. Test timing and timeouts are only reliable when using Xunit.Sdk.ParallelAlgorithm.Conservative (or when parallelization is disabled completely).

    Implements

    Xunit.v3.IFactAttribute

    Extension Methods

    ObjectExtensions.IsDefaultForType<T>(T)
    ObjectExtensions.AsOption<T>(T)
    Extensions.AsInstanceOf<T>(object)
    In this article
    • githubEdit this page
    • View Source
    Back to top
    Contribute
    • Project Chat
    • Discussion Forum
    • Source Code
    Support
    • Akka.NET Support Plans
    • Akka.NET Observability Tools
    • Akka.NET Training & Consulting
    Maintained By
    • Petabridge - The Akka.NET Company
    • Learn Akka.NET