Test method name should follow conventions

This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Metadata

ID: csharp-best-practices/test-method-names

Language: C#

Severity: Info

Category: Best Practices

Description

Test methods should follow the following guidelines:

  • must be public and not async
  • the name should start with Test

Learn More

Non-Compliant Code Examples

class MyTests {
    [TestMethod]
    void FooBar()
    {

    }

    [TestMethod]
    public async void BlipBlop()
    {

    }
}

Compliant Code Examples

class MyTests {
    [TestMethod]
    public void TestSomething()
    {

    }
}
https://static.datadoghq.com/static/images/logos/github_avatar.svg https://static.datadoghq.com/static/images/logos/vscode_avatar.svg jetbrains

Seamless integrations. Try Datadog Code Analysis

PREVIEWING: piotr_wolski/update-dsm-docs