Skip to content

Add new generic collections unit tests - #180

Merged
josesimoes merged 2 commits into
developfrom
add-new-tests
Jul 23, 2026
Merged

Add new generic collections unit tests#180
josesimoes merged 2 commits into
developfrom
add-new-tests

Conversation

@josesimoes

@josesimoes josesimoes commented Jul 23, 2026

Copy link
Copy Markdown
Member

Description

Motivation and Context

How Has This Been Tested?

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dependencies (update dependencies and changes associated, has no impact on code or features)
  • Unit Tests (add new Unit Test(s) or improved existing one(s), has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist:

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).
  • I have added new tests to cover my changes.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: nanoframework/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 46686846-3284-4a31-9c96-3b3ece913265

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added tests covering Add() behavior and state retention for static readonly List<int> and List<DummyClass> instances, along with a shared static holder for the lists.

Changes

Static list tests

Layer / File(s) Summary
Static list state validation
Tests/GenericCollections/ListTests.cs
StaticListHolder provides static readonly integer and reference-type lists; new tests verify counts and stored element values after Add() calls.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: Type: Unit Tests

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the added generic collections unit tests and stays concise.
Description check ✅ Passed The description is clearly related to the test additions and their purpose.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@josesimoes

Copy link
Copy Markdown
Member Author

Unit tests are supposed to fail on 1st pass.

@josesimoes

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Tests/GenericCollections/ListTests.cs`:
- Around line 1206-1231: Reset the mutable static state used by
List_StaticField_ValueType_Add and List_StaticField_ReferenceType_Add after each
test by clearing StaticListHolder.Numbers and StaticListHolder.Items. Preserve
StaticListHolder’s static field initializer and ensure cleanup runs even when
assertions fail, so retries and reruns start with empty lists.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: nanoframework/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2ffbf01e-adc9-456b-9d5d-ea64ce49caa1

📥 Commits

Reviewing files that changed from the base of the PR and between ca3606b and c345ce6.

📒 Files selected for processing (1)
  • Tests/GenericCollections/ListTests.cs

Comment thread Tests/GenericCollections/ListTests.cs
@josesimoes
josesimoes enabled auto-merge (squash) July 23, 2026 11:12
@josesimoes

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@sonarqubecloud

Copy link
Copy Markdown

@josesimoes
josesimoes merged commit da12208 into develop Jul 23, 2026
8 checks passed
@josesimoes
josesimoes deleted the add-new-tests branch July 23, 2026 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants