Test method name should follow conventions

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