|
15 | 15 | * Use pattern matching and switch expressions wherever possible. |
16 | 16 | * Use `nameof` instead of string literals when referring to member names. |
17 | 17 | * Ensure that XML doc comments are created for any public APIs. When applicable, include `<example>` and `<code>` documentation in the comments. |
18 | | -* Do not add XML documentation comments to non-public API members (internal, private). Only public APIs should have XML documentation. |
19 | | -* Do not add comments that explain the code itself, such as "This method does X". Only add comments that explain why a specific approach was chosen or why something is done in a particular way. |
20 | | - * Comments are needed when the code relies on specific behavior or implementation details of another component or system. |
21 | 18 |
|
22 | 19 | ### Nullable Reference Types |
23 | 20 |
|
|
31 | 28 | * Do not emit "Act", "Arrange" or "Assert" comments. |
32 | 29 | * Use Moq for mocking in tests. |
33 | 30 | * Copy existing style in nearby files for test method names and capitalization. |
34 | | -* Do not test simple members. |
35 | | - * As a rule of thumb, if a member does not contain any control flow instruction, you don't need to test it. |
36 | | - * Do not test constructor parameters for null or any internal methods for null. |
37 | 31 |
|
38 | 32 | ## Running tests |
39 | 33 |
|
40 | 34 | * To build and run tests in the repo, use the `build.sh` script that is located in each subdirectory within the `src` folder. For example, to run the build with tests in the `src/Http` directory, run `./src/Http/build.sh -test`. |
41 | | -* When adding new tests, ALWAYS run the specific tests you are adding before running the full test suite. |
42 | | -* When your new tests pass, ALWAYS run the tests on the class before running the full test suite. |
43 | | -* ALWAYS ask for confirmation before running the full test suite. |
44 | | -* When debugging specific test failures, you can run individual tests with filtering: |
45 | | - ``` |
46 | | - dotnet test <project-path> --filter DisplayName~TestMethodName --logger "console;verbosity=normal" |
47 | | - ``` |
48 | | -* For running multiple specific tests, use pipe syntax: `--filter DisplayName~FirstTest|DisplayName~SecondTest`. |
49 | | -* Build projects locally with `dotnet build <project-path> --no-restore` for faster validation before running tests. |
50 | | -* For UI/interaction tests, run only one test at a time using filters as those tests are very expensive to run. |
51 | | - |
0 commit comments