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