Skip to content

Commit

Permalink
Conventions on test scenarios files (#9235)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioaversa authored May 30, 2024
1 parent 80811f9 commit 625c2cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/coding-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,13 @@ Do not use `ValueTuples` in production code. The usage in test projects is fine.

Empty lines should be used between blocks, `Namespace`/`End Namespace` statements, `Class`/`End Class` statements
and regions to improve readability.

## Test scenarios files

For any C# rule `TheRule`, there should be at least two test scenarios files:
* `TheRule.cs`, targeting both .NET Framework and .NET Core and using the default version of C#
* `TheRule.Latest.cs`, targeting .NET Core only (via `# if NET`) and using the latest version of C#

More test scenarios files can be created as needed, for code fixes, top-level statements etc.

In the past, test scenarios were split by language (e.g. `TheRule.CSharpX.cs`). These files should be migrated, following a Clean as You Code approach.

0 comments on commit 625c2cb

Please sign in to comment.