Skip to content

Fix unit test for String.Format()#269

Merged
josesimoes merged 2 commits intonanoframework:developfrom
josesimoes:fix-string-format
Apr 23, 2026
Merged

Fix unit test for String.Format()#269
josesimoes merged 2 commits intonanoframework:developfrom
josesimoes:fix-string-format

Conversation

@josesimoes
Copy link
Copy Markdown
Member

@josesimoes josesimoes commented Apr 23, 2026

Description

  • Now expecting ArgumentNullException.
  • Improve IntelliSense comment to include ArgumentNullException.

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.

- Now expecting ArgumentNullException.
- Improve IntelliSense comment to include ArgumentNullException.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

📝 Walkthrough

Walkthrough

The changes update String.Format method behavior documentation and align unit tests to reflect that ArgumentNullException is thrown when a null format string argument is provided, rather than NullReferenceException.

Changes

Cohort / File(s) Summary
Test Exception Expectation
Tests/NFUnitTestArithmetic/UnitTestFormat.cs
Updated StringFormat_01 test to expect ArgumentNullException instead of NullReferenceException when format string is null.
API Documentation
nanoFramework.CoreLibrary/System/String.cs
Added ArgumentNullException exception tag to XML documentation for String.Format method.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: fixing a unit test for String.Format(), which directly relates to the changeset.
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.
Description check ✅ Passed The pull request description clearly explains the changes: updating unit tests to expect ArgumentNullException and improving XML documentation comments to match .NET behavior.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

@josesimoes
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

✅ Actions performed

Review triggered.

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

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 the current code and only fix it if needed.

Inline comments:
In `@nanoFramework.CoreLibrary/System/String.cs`:
- Line 718: The XML doc for the String APIs contains a stray double quote after
the closing </exception> tag (in System.String docs around String.cs) which
breaks generated docs; edit the XML comment to remove the trailing '"' so the
</exception> tag ends cleanly and ensure the surrounding <exception> entry for
parameters "format" and "args" remains well-formed (no other stray characters)
in the String class documentation.
🪄 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

Run ID: ab6bdfd0-6303-4b5d-bb6a-7afcfd0a8793

📥 Commits

Reviewing files that changed from the base of the PR and between c326223 and 006dce8.

📒 Files selected for processing (2)
  • Tests/NFUnitTestArithmetic/UnitTestFormat.cs
  • nanoFramework.CoreLibrary/System/String.cs

Comment thread nanoFramework.CoreLibrary/System/String.cs Outdated
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@josesimoes josesimoes merged commit 2aa5d2a into nanoframework:develop Apr 23, 2026
7 checks passed
@josesimoes josesimoes deleted the fix-string-format branch April 23, 2026 09:59
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