Skip to content
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

Microsoft.Extensions Plugin - Create abstraction and improve unit tests #475

Conversation

304NotModified
Copy link
Contributor

🤔 What's changed?

Changed the abstraction of the Reqnroll.Microsoft.Extensions.DependencyInjection.ServiceCollectionFinder

⚡️ What's your motivation?

So I tried to change the plugin, but it was missing tests. I made a new abstraction so the Finder is easy to test.

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)

♻️ Anything particular you want feedback on?

  • The new interfaces (internal)
  • The internalsvisibleto
  • A bug? The AddBindingAttributes is called for every assembly and loops also the assemblies? This was the original code? Looks wrong to me

📋 Checklist:

  • get feedback

@304NotModified 304NotModified changed the title Plugin - Create abstraction and improve unit tests Microsoft.Extensions Plugin - Create abstraction and improve unit tests Feb 18, 2025
@304NotModified
Copy link
Contributor Author

So I missed https://github.com/orgs/reqnroll/discussions/472

Maybe we could use this code/idea or not. I haven't read it in its entirety yet

@gasparnagy
Copy link
Contributor

The idea makes sense.
One addition: While working on the DI prototype, I realized that the binding assemblies can be queried in an easier way: ITestRunnerManager.BindingAssemblies (the ITestRunnerManager is registered in the test run (global) context so accessible everywhere.

@304NotModified
Copy link
Contributor Author

is it useful to continue with this, as we have https://github.com/orgs/reqnroll/discussions/472?

Im also fine to fully focus on https://github.com/orgs/reqnroll/discussions/472

@gasparnagy
Copy link
Contributor

I'm ok with both, but you are right it is probably easier to see the necessary abstractions once we have the new model merged in.

@304NotModified
Copy link
Contributor Author

304NotModified commented Feb 20, 2025

I was wrong this one. We could mock Assembly as it's an abstract class, so we do need this abstraction

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.

2 participants