chore(deps): update NSubstitute to 6.2.0

未關閉
#592 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
72/100
Issue 類型
重構
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
csharp
領域
testing

研究方向

Start with Directory.Packages.props and tests/Directory.Build.props to confirm where NSubstitute is centrally versioned and used. Check that version 6.2.0 is available on NuGet, then build and run tests/CommunityToolkit.Datasync.Client.Test and tests/CommunityToolkit.Datasync.Server.Test first. Update the package version and make minimal test changes for any failures; done means all tests pass locally and in CI with the same test counts.

由索引模型根據 Issue 內容生成。

描述

dependencies Infrastructure

Part 6 of the outdated-package sweep (dotnet-outdated 4.8.1, 2026-11-05). Major upgrade of NSubstitute used across all test projects.

Current state

NSubstitute 5.3.0 in root Directory.Packages.props; referenced for every project under tests/ via tests/Directory.Build.props. Target: 6.2.0.

What changes

  • 6.0.0: targets .NET 8 / .NET Standard 2.0 (fine for us on net10.0); improved custom argument matcher support (Arg.Is accepts arg matchers); new ArgMatchers.Matching; some breaking changes for custom argument matchers.
  • 6.1.0: reverted the nullability annotations introduced in 6.0 (they caused caller problems), so the public API is non-nullable-annotated again. Avoid 6.0.x; go straight to 6.2.
  • 6.2.0: improved generic call matching (generic return-type assignability no longer used for matching), trusted NuGet publishing.
    Release notes: https://github.com/nsubstitute/NSubstitute/releases

Expected impact is small; the most likely breakage is tests that mock generic methods and relied on return-type assignability matching, or custom IArgumentMatcher implementations.

Steps

  1. Bump NSubstitute to 6.2.0 (confirm it exists on NuGet).
  2. dotnet build then dotnet test. Run first the projects most likely to use mocks heavily (tests/CommunityToolkit.Datasync.Client.Test, tests/CommunityToolkit.Datasync.Server.Test).
  3. Fix any failures with minimal test changes; do not alter production code.
  4. Dispatch build-library.yml on the fork with --ref <branch>.

Acceptance criteria

  • Tests pass with NSubstitute 6.2.0 locally and in CI, with the same test counts as before.
  • PR title: chore(deps): update NSubstitute to 6.2.0.
主要語言
C#
星號
184
分支
48
平均合併
21 分鐘
30 天內合併 PR
7

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

CommunityToolkit/Datasync 的其他 Issue

查看 CommunityToolkit/Datasync 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。