Skip to content

InternalsVisibleTo NHibernate.Test #3682

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gliljas
Copy link
Member

@gliljas gliljas commented Aug 5, 2025

Allowing the test project to access internal types and members in the main project opens up for cleaner and less brittle tests, without having to resort to file linking or reflection. It potentially triggers internalizing things that ideally should be private, but I think that's a smaller issue.

Since the NHibernate assembly is strong named, this required the same thing for NHibernate.Test and NHibernate.DomainModel. Potentially, the entire strong naming could be toggled off in build scenarios where it's not needed. Not done here, but the PropertyGroups etc. have been kept separate, so that they can be made conditional.

@gliljas gliljas requested a review from Copilot August 5, 2025 13:08
Copy link

@Copilot 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 PR enables the NHibernate.Test project to access internal types and members from the main NHibernate project through the InternalsVisibleTo attribute, allowing for cleaner and less brittle tests.

  • Adds InternalsVisibleTo attribute to expose NHibernate internals to the test project
  • Enables strong naming for NHibernate.Test and NHibernate.DomainModel assemblies to satisfy strong naming requirements
  • Removes file linking for internal classes now that they're accessible via InternalsVisibleTo

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/NHibernate/NHibernate.csproj Adds InternalsVisibleTo attribute with public key for NHibernate.Test
src/NHibernate.Test/NHibernate.Test.csproj Enables strong naming and removes file linking for internal classes
src/NHibernate.Test/ExceptionsTest/OracleClientExceptionConverterExample.cs Updates Oracle exception handling to use reflection instead of direct type access
src/NHibernate.DomainModel/NHibernate.DomainModel.csproj Enables strong naming to maintain assembly compatibility

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.

1 participant