Skip to content

Commit

Permalink
Fix line length in help
Browse files Browse the repository at this point in the history
  • Loading branch information
manfred-brands committed Jul 26, 2024
1 parent b1fa587 commit 2149eca
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions documentation/NUnit1033.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@ Direct Write calls should be replaced with Out.Write.

## Motivation

The `Write` methods are simple wrappers calling `Out.Write`. There is no wrapper for `Error` which always required to use `TestContext.Error.Write`.
Besides this being inconsistent, later versions of .NET added new overloads, e.g. for `ReadOnlySpan<char>` and `async` methods like `WriteAsync`.
Instead of adding more and more dummy wrappers, it was decided that user code should use the `Out` property and then can use any `Write` overload available on `TextWriter`.
The `Write` methods are simple wrappers calling `Out.Write`.
There is no wrapper for `Error` which always required to use `TestContext.Error.Write`.
Besides this being inconsistent, later versions of .NET added new overloads,
e.g. for `ReadOnlySpan<char>` and `async` methods like `WriteAsync`.
Instead of adding more and more dummy wrappers, it was decided that user code should use
the `Out` property and then can use any `Write` overload available on `TextWriter`.

## How to fix violations

Simple insert `.Out` between `TestContext` and `.Write`.

`TestContext.WriteLine("This isn't right");`

becomes

`TestContext.Out.WriteLine("This isn't right");`

<!-- start generated config severity -->
## Configure severity

Expand Down

0 comments on commit 2149eca

Please sign in to comment.