From 73586ff9972ac4a53b8133fee5d69f321d6f162e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:14:02 +0000 Subject: [PATCH 1/2] Initial plan for issue From 358664deaa9e5eefa09e557c5893c1c17c257624 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Jun 2025 13:17:43 +0000 Subject: [PATCH 2/2] Fix incorrect dotnet CLI command in NUnit tutorial Co-authored-by: gewarren <24882762+gewarren@users.noreply.github.com> --- docs/core/testing/unit-testing-csharp-with-nunit.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/core/testing/unit-testing-csharp-with-nunit.md b/docs/core/testing/unit-testing-csharp-with-nunit.md index 0e0f1f48763f7..6c2e180417de0 100644 --- a/docs/core/testing/unit-testing-csharp-with-nunit.md +++ b/docs/core/testing/unit-testing-csharp-with-nunit.md @@ -86,12 +86,15 @@ The [dotnet new](../tools/dotnet-new.md) command creates a test project that use > [!NOTE] > 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. -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: +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: ```dotnetcli -dotnet reference add ../PrimeService/PrimeService.csproj +dotnet add reference ../PrimeService/PrimeService.csproj ``` +> [!NOTE] +> If you're using .NET 10 SDK or later, you can use the "noun first" form: `dotnet reference add ../PrimeService/PrimeService.csproj`. + 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. The following outline shows the final solution layout: