Skip to content

chore(tests): clear all build warnings - #89

Merged
cosmin-staicu merged 1 commit into
mainfrom
chore/fix-build-warnings
Jul 17, 2026
Merged

chore(tests): clear all build warnings#89
cosmin-staicu merged 1 commit into
mainfrom
chore/fix-build-warnings

Conversation

@cosmin-staicu

Copy link
Copy Markdown
Member

Summary

Drives the solution to a warning-free build (0 warnings, down from 104 CS8604 + 6 NU1608). Test/build hygiene only — no product code changes.

Changes

  • CS8604 (possible null reference argument — 26 unique test sites in RedisCacheTests, MultilayerCacheTests, RedisPubSubTopicTests, RedisStreamNotifyChannelTests, RedisStreamSubjectWriterTests):
    • NSubstitute Arg.Is<T[]>(k => k.Contains(...)) matcher lambdas receive a nullable parameter, so the predicates now guard with k != null && ... before .Contains — matching the convention already used elsewhere in these files (e.g. MultilayerCacheTests lines 169/1004).
    • CallInfo.Arg<T>() values passed to List.Add / TaskCompletionSource.TrySetResult use the null-forgiving operator (!).
  • NU1608: AutoFixture.AutoNSubstitute 4.18.1 caps NSubstitute at < 6.0.0, but the pin is 6.0.0 (the latest stable) and passes all tests. No AutoFixture.AutoNSubstitute version — including 5.0.0-preview — yet permits NSubstitute 6, so the constraint notice is suppressed in the test project (NoWarn) with a justifying comment, rather than downgrading off the latest NSubstitute.

Test plan

  • Unit tests added/updated
  • Integration tests pass locally (dotnet test)
  • CHANGELOG.md updated

Full suite green on net8.0 and net10.0 (1182/1182 each), and a forced rebuild (--no-incremental) emits 0 warnings.

Linked issues

Fixes #

Contributor declaration

  • I signed off my commits per the DCO (git commit -s).
  • I am contributing on behalf of my employer, or in the course of employment / using employer resources.

🤖 Generated with Claude Code

Drives the solution to a warning-free build.

- CS8604 (possible null reference argument, 26 sites, test-only): NSubstitute
  Arg.Is<T[]>(...) matcher lambdas get a nullable parameter, so guard the
  predicate with `param != null &&` before calling .Contains (matching the
  existing convention already used elsewhere in these files); CallInfo.Arg<T>()
  values passed to Add/TrySetResult use the null-forgiving operator.
- NU1608: AutoFixture.AutoNSubstitute 4.18.1 caps NSubstitute at <6.0.0, but
  the pin is 6.0.0 (latest) and passes all tests. No AutoFixture version
  (incl. 5.0 previews) yet allows NSubstitute 6, so suppress the transitive
  constraint notice in the test project rather than downgrade.

No product code changes. Full suite green on net8.0 and net10.0 (1182/1182
each); build emits 0 warnings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
@sonarqubecloud

Copy link
Copy Markdown

@cosmin-staicu
cosmin-staicu merged commit a90eb88 into main Jul 17, 2026
9 checks passed
@cosmin-staicu
cosmin-staicu deleted the chore/fix-build-warnings branch July 17, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants