Skip to content

Conversation

@erwan-joly
Copy link
Contributor

Updated all project files and CI/CD workflow to target .NET 10:

  • src/NosCore.Packets/NosCore.Packets.csproj: net8.0 → net10.0
  • test/NosCore.Packets.Benchmark/NosCore.Packets.Benchmark.csproj: net8.0 → net10.0
  • test/NosCore.Packets.Tests/NosCore.Packets.Tests.csproj: net8.0 → net10.0
  • .github/workflows/dotnet.yml: dotnet-version 8.0.x → 10.0.x

Updated all project files and CI/CD workflow to target .NET 10:
- src/NosCore.Packets/NosCore.Packets.csproj: net8.0 → net10.0
- test/NosCore.Packets.Benchmark/NosCore.Packets.Benchmark.csproj: net8.0 → net10.0
- test/NosCore.Packets.Tests/NosCore.Packets.Tests.csproj: net8.0 → net10.0
- .github/workflows/dotnet.yml: dotnet-version 8.0.x → 10.0.x
Updated test and benchmark project packages:

Benchmark project:
- BenchmarkDotNet: 0.13.12 → 0.15.7
- Microsoft.CodeAnalysis.CSharp: 4.10.0 → 4.14.0

Test project:
- coverlet.collector: 6.0.2 → 6.0.4
- Microsoft.NET.Test.Sdk: 17.10.0 → 18.0.1
- Moq: 4.20.70 → 4.20.72
- MSTest.TestAdapter: 3.4.3 → 4.0.2
- MSTest.TestFramework: 3.4.3 → 4.0.2
- Verify.MSTest: 25.0.3 → 30.20.1
…sions

Fixes:
- Updated actions/checkout from v2 to v4
- Updated actions/setup-dotnet from v3 to v4 for better .NET 10 support
- Replaced deprecated 'create' event with 'push' tags filter
- Fixed deprecated 'echo ::set-output' syntax with $GITHUB_OUTPUT
- Fixed tag reference from github.event.ref to github.ref
- Properly extract tag name using bash parameter expansion
- Replaced deprecated actions/upload-release-asset@v1 with softprops/action-gh-release@v2
- Removed unnecessary jossef/action-latest-release-info step
- Fixed GITHUB_TOKEN reference to use secrets.GITHUB_TOKEN
….AreEqual

Replaced Assert.IsTrue(x == y) with Assert.AreEqual(expected, actual) throughout test files
to comply with MSTest analyzer MSTEST0037 which requires more specific assertion methods.

Changes:
- DeserializerTest.cs: Updated 75 assertions to use Assert.AreEqual for equality checks
- SerializerTest.cs: Updated 1 assertion to use Assert.IsNotNull for null checks

This fixes compilation errors caused by TreatWarningsAsErrors being enabled with the
newer MSTest 4.0.2 analyzer rules.
- Fixed typo in test project: TreatWrningsAsErrors -> TreatWarningsAsErrors
- Restored CS1591 (missing XML documentation) suppression to prevent build failures

The codebase has many public APIs without XML documentation. While CS1591 warnings
are useful, adding documentation to all public members is beyond the scope of the
.NET 10 upgrade. The suppression allows the build to succeed while maintaining
other strict warning-as-error enforcement.
Changes:
- Suppress AD0001 analyzer error in Benchmark project (BenchmarkDotNet incompatibility with .NET 10)
- Add test parallelization configuration to fix MSTEST0001 error
- Fix MSTEST0037 errors by using correct assertion methods:
  * Assert.IsNull instead of Assert.AreEqual for null checks
  * Assert.HasCount instead of Assert.AreEqual for collection counts
  * Assert.IsFalse instead of Assert.AreEqual for boolean checks
- Fix MSTEST0017 error by correcting assertion argument order
- Fix CS0411 type inference errors by adding explicit type casts

Test files updated:
- DeserializerTest.cs: 8 assertion method fixes
- SerializerTest.cs: 1 assertion method fix
- Test project: Added ParallelizeAttribute configuration
- Benchmark project: Suppressed analyzer compatibility warning
The assembly-level ParallelizeAttribute configuration was causing a build error.
Simplified by suppressing MSTEST0001 analyzer warning instead, which is a
recommendation rather than a critical requirement.
- Corrected Assert.HasCount calls - signature is (expectedCount, collection) not (collection, count)
- Fixed type cast on line 242: CreateShopPacketType to byte
- Added null-forgiving operators to fix CS8604 warnings on .First() calls
Changed Assert.AreEqual((byte)0, value) to Assert.AreEqual<byte>(0, value)
to help the compiler infer the correct type for the assertion on lines 242-243.
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.

3 participants