Skip to content

Commit 35f707c

Browse files
authored
Fix incorrect dotnet CLI command in NUnit tutorial (#46920)
1 parent 9311fbf commit 35f707c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

docs/core/testing/unit-testing-csharp-with-nunit.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,15 @@ The [dotnet new](../tools/dotnet-new.md) command creates a test project that use
8686
> [!NOTE]
8787
> Prior to .NET 9, the generated code may reference older versions of the NUnit test framework. You may use [dotnet CLI](/nuget/consume-packages/install-use-packages-dotnet-cli) to update the packages. Alternatively, open the *PrimeService.Tests.csproj* file and replace the contents of the package references item group with the code above.
8888
89-
The test project requires other packages to create and run unit tests. The `dotnet new` command in the previous step added the Microsoft test SDK, the NUnit test framework, and the NUnit test adapter. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet reference add`](../tools/dotnet-reference-add.md) command:
89+
The test project requires other packages to create and run unit tests. The `dotnet new` command in the previous step added the Microsoft test SDK, the NUnit test framework, and the NUnit test adapter. Now, add the `PrimeService` class library as another dependency to the project. Use the [`dotnet add reference`](../tools/dotnet-reference-add.md) command:
9090

9191
```dotnetcli
92-
dotnet reference add ../PrimeService/PrimeService.csproj
92+
dotnet add reference ../PrimeService/PrimeService.csproj
9393
```
9494

95+
> [!NOTE]
96+
> If you're using .NET 10 SDK or later, you can use the "noun first" form: `dotnet reference add ../PrimeService/PrimeService.csproj`.
97+
9598
You can see the entire file in the [samples repository](https://github.com/dotnet/samples/blob/main/core/getting-started/unit-testing-using-nunit/PrimeService.Tests/PrimeService.Tests.csproj) on GitHub.
9699

97100
The following outline shows the final solution layout:

0 commit comments

Comments
 (0)