Search Results for

    Show / Hide Table of Contents

    Author

    AuthorAttribute adds information about the author of tests. This metadata can be used by test runners and reporting tools to track test ownership and contact information.

    Constructors

    AuthorAttribute(string name)
    AuthorAttribute(string name, string email)
    
    Parameter Type Description
    name string The name of the test author.
    email string The email address of the author. When provided, stored as "name <email>".

    Applies To

    Test Methods Test Fixtures (Classes) Assembly
    ✅ ✅ ✅

    Alternative Syntax

    Author can also be specified as a named parameter on [TestFixture] or [Test] attributes (name only, no email):

    [TestFixture(Author = "Jane Doe")]
    [Test(Author = "Joe Developer")]
    

    Example

    [TestFixture]
    [Author("Jane Doe", "jane.doe@example.com")]
    [Author("Another Developer", "email@example.com")]
    public class MyTests
    {
        [Test]
        public void Test1() { /* ... */ }
    
        [Test]
        [Author("Joe Developer")]
        [Author("Yet Another Developer", "not.my.email@example.com")]
        public void Test2() { /* ... */ }
    }
    
    [TestFixture(Author = "Jane Doe")]
    public class MyOtherTests
    {
        [Test]
        public void Test1() { /* ... */ }
    
        [Test(Author = "Joe Developer")]
        public void Test2() { /* ... */ }
    }
    

    Notes

    1. This attribute inherits from PropertyAttribute and sets the Author property.
    2. Multiple Author attributes can be applied to the same fixture or test (since NUnit 3.7).
    3. Prior to NUnit 3.7, only one Author attribute was allowed per fixture or test.
    4. When using the named parameter syntax (Author = "name"), only the name can be specified, not the email.

    See Also

    • Property Attribute
    • Description Attribute
    • TestOf Attribute
    • Edit this page
    In this article
    Back to top Generated by DocFX | Copyright (c) 2018- The NUnit Project - Licensed under CC BY-NC-SA 4.0