Skip to content

Conversation

@currantw
Copy link
Collaborator

@currantw currantw commented Oct 23, 2025

Fix Unit Test Lint Errors

Fixes #114: Resolves all unit test lint errors.

Errors Fixed

  • IDE0300 (72 errors): Updated verbose collection initialization to modern collection expressions
  • IDE0028 (14 errors): Simplified collection initialization syntax
  • IDE0305 (10 errors): Applied collection expression patterns where applicable
  • IDE0301 (6 errors): Modernized remaining collection initializations
  • CS8625 (52 errors): Added null-forgiving operators ! for intentional null test scenarios
  • CS8604 (8 errors): Fixed possible null reference arguments
  • CS8602 (2 errors): Resolved null reference dereferences
  • CS8629 (2 errors): Handled nullable value type issues
  • IDE0005: Removed unused using statements across all affected files:
  • CS1998: Removed async keyword from methods without await operators and added explicit return Task.CompletedTask statements

Files Updated

  • CommandTests.cs (154 errors → 0)
  • SortedSetCommandTests.cs (16 errors → 0)
  • ReadFromTests.cs (8 errors → 0)
  • BoundaryTests.cs (2 errors → 0)
  • ConnectionMultiplexerReadFromMappingTests.cs (2 errors → 0)
  • ScriptStorageTests.cs (2 errors → 0)

Acceptance Criteria

  • Unit test lint build passes with no errors: dotnet build tests/Valkey.Glide.UnitTests/ --configuration Lint --framework net8.0
  • All existing unit tests still pass: dotnet test --filter "FullyQualifiedName~Valkey.Glide.UnitTests"
  • No new warnings introduced
  • Code maintains readability and test intent

@currantw currantw marked this pull request as ready for review October 23, 2025 17:24
@currantw currantw requested a review from a team as a code owner October 23, 2025 17:24
@currantw currantw requested a review from Copilot October 23, 2025 18:28
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request resolves lint errors in unit test files by applying modern C# collection syntax, fixing nullable reference warnings, and removing unused imports. The changes bring the test code in line with current C# best practices while maintaining all test functionality.

Key Changes

  • Updated to modern collection expression syntax (IDE0300, IDE0028, IDE0305, IDE0301)
  • Added null-forgiving operators for intentional null test scenarios (CS8625, CS8604, CS8602, CS8629)
  • Removed unused using Xunit; and using System.Linq; statements (IDE0005)
  • Fixed async methods without await by removing async keyword and adding explicit Task.CompletedTask returns (CS1998)

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
CommandTests.cs Modernized collection initializations, added null-forgiving operators for test scenarios, removed unused Xunit import
SortedSetCommandTests.cs Applied collection expressions, added null-forgiving operators, removed unused imports
ReadFromTests.cs Fixed async method signatures, removed unused Xunit import
BoundaryTests.cs Removed unused Xunit import
ConnectionMultiplexerReadFromMappingTests.cs Removed unused Xunit import

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@xShinnRyuu xShinnRyuu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@currantw currantw merged commit 52b21f8 into valkey-io:main Oct 24, 2025
11 checks passed
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.

Fix lint errors in unit test files to pass CI pipeline

3 participants