You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
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.
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
changed the title
Factories defined by consumer do not get registered
Simplify loading of factories by consumers
Oct 19, 2020
myty
transferred this issue from another repository
Dec 17, 2021
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 fromBaseTest
and has its own static constructor that calls into theLoadFactories
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.The text was updated successfully, but these errors were encountered: