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

Simplify loading of factories by consumers #44

Open
jebediahelliott opened this issue Oct 16, 2020 · 3 comments
Open

Simplify loading of factories by consumers #44

jebediahelliott opened this issue Oct 16, 2020 · 3 comments
Labels
testing Anything related to the Testing project

Comments

@jebediahelliott
Copy link

Factories defined by a project that is consuming this library do not get registered. The static constructor for BaseTest passes in the assembly information for this library to the method that registers factories so only factories defined in this library get registered. As a workaround I created a local base test class that inherits from BaseTest and has its own static constructor that calls into the LoadFactories method with the local assembly as a parameter. If this is the intended usage then I can add documentation around that. If not, I can start work on a refactor and any guidance would be appreciated because I quite honestly am not sure where to start.

@brandongregoryscott
Copy link
Contributor

brandongregoryscott commented Oct 19, 2020

I believe this is intended behavior - for consuming projects it is common to define your own 'base test' class that inherits from one of these base test classes with any configuration/setup necessary for the suite, and opts in to registering its own factories, if it has any. Based on the readme, looks like we never got around to filling in more documentation around how to start leveraging the factories.

@jebediahelliott
Copy link
Author

I think you are right. After I wrote this issue, I noticed that the Core library defines it's own base test class with a static constructor to register factories. I'll update the readme and include an example.

@wintondeshong
Copy link
Contributor

wintondeshong commented Oct 19, 2020

Sorry for the delayed response. At this time, the above approach is how consumers load factories. The hope is to fully abstract factories into its own library and make this loading easier on consumers. That said, if anyone wants to improve the loading of these factories now, totally down for any PRs 👍

Perhaps we update the title of this issue to "Simplify loading of factories by consumers"

@jebediahelliott jebediahelliott changed the title Factories defined by consumer do not get registered Simplify loading of factories by consumers Oct 19, 2020
@myty myty transferred this issue from another repository Dec 17, 2021
@myty myty added the testing Anything related to the Testing project label Dec 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Anything related to the Testing project
Projects
None yet
Development

No branches or pull requests

4 participants