Skip to content

Add tests for explicit interface calls on generic base - #321

Merged
josesimoes merged 1 commit into
developfrom
add-explicit-interface-generic-base-tests
Nov 27, 2026
Merged

josesimoes merged 1 commit into
developfrom
add-explicit-interface-generic-base-tests

Conversation

@josesimoes

@josesimoes josesimoes commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Description

  • Add tests for an explicit non-generic interface implementation on an abstract generic base class, using value is T and (T)GetValue() in the base.
  • Cover bool, int, string and a small struct: set through the interface then get returns the boxed value, a wrong type and null throw ArgumentException.

Motivation and Context

How Has This Been Tested?

  • Expected values checked on .NET 10: 10 of 10 pass.
  • NFUnitTestSystemLibReflection3 on the netcore nanoCLR (develop 1744d9808): 147 passed, 0 failed, including the 10 new tests.

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.

- Add tests for the scenario of Home 1947 for bool, int, string and a struct.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@nfbot nfbot left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ The PR template looks good now. Thanks!

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML; Path: .coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: fe9c4639-b925-4d88-b149-a9aedffc7250
Commits

Reviewing files that changed from the base of the PR and between 1a521c3 and 0b44a0c.

Files selected for processing: 2

  • Tests/NFUnitTestSystemLibReflection3/NFUnitTestSystemLibReflection3.nfproj
  • Tests/NFUnitTestSystemLibReflection3/UnitTestExplicitInterfaceOnGenericBaseTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@josesimoes

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

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.

Copilot AI 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.

🟢 Approval recommended

No active review issues were identified in the regression-test additions and project inclusion.

No open issues 🎉

What changed in this PR

Adds regression coverage for explicit non-generic interface calls on an abstract generic base class in the nanoFramework BCL test suite, addressing the scenario in Home#1947 without changing runtime or library code.

Changes:

  • Adds 10 tests covering bool, int, string, and a small struct.
  • Checks value round-trips, rejection of wrong types and null, and replacement of previously stored values.
  • Includes the new tests in the existing reflection test project.
File Description
Tests/​NFUnitTestSystemLibReflection3/​UnitTestExplicitInterfaceOnGenericBaseTests.cs Adds generic-base explicit interface regression tests.
Tests/​NFUnitTestSystemLibReflection3/​NFUnitTestSystemLibReflection3.nfproj Includes the new test source in compilation.

Review effort: Balanced

@josesimoes

Copy link
Copy Markdown
Member Author

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown
Action performed

Comments resolved and changes approved.

@josesimoes
josesimoes enabled auto-merge (squash) November 27, 2026 13:48
@sonarqubecloud

Copy link
Copy Markdown

@josesimoes
josesimoes merged commit c00d7c7 into develop Nov 27, 2026
7 checks passed
@josesimoes
josesimoes deleted the add-explicit-interface-generic-base-tests branch November 27, 2026 13:56
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.

3 participants