簡體   English   中英

如何在 Visual Studio 2022 中設置 NUnit?

[英]How do I set up NUnit in Visual Studio 2022?

NUnit 是否在 Visual Studio 2022 下工作? 我能找到的所有設置說明都與以前版本的 Visual Studio 相關,並引用了不存在的內容(例如“工具 -> Visual Studio 中的管理擴展菜單。單擊在線並輸入搜索詞作為 NUnit 測試適配器” -搜索沒有結果)。 如果它確實有效,我該如何設置它?

您可以使用 NuGet 包添加 NUnit 框架和 NUnit 測試適配器。

To do that, right click on your project in Solution Explorer, go to Manage NuGet packages... , in the Browse section type nunit , install NUnit package and the corresponding version adapter (NUnitTestAdapter for NUnit 2.x or NUnit3TestAdapter for NUnit 3. X)。

FWIW,我同時安裝了 NUnit Framework 和 NUnit Test Adapter 包,但我的測試仍然被忽略。 我還必須安裝 Microsoft.NET.Test.Sdk package。 我似乎總是忘記這個。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM