chore(deps): update NSubstitute to 6.2.0

Aperta
#592 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
testing

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.
Lingua principale
C#
Stelle
184
Fork
48
Merge medio
21m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CommunityToolkit/Datasync

Tutte le issue di CommunityToolkit/Datasync

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.