Closed SimonG96 closed 2 years ago
How to validate factories?
ValidateFactories().WithArgument<IABC>(new ABC()).WithArgument<IBCE>(new BCE());
or more specific?
Not quite sure yet
better:
container.AddFactoryValidation<ITestFactory>().WithArgument<string>("hi");
..
..
container.ValidateFactories()
throwing exception if not for all factories a validation is registered
What about factories with multiple create methods?
Validate everything by calling Validate()
Special parameters can be added by calling AddParameter<TInterface, TParameter>(parameter)
What about factories with multiple create methods?
Every create method is verified if it can successfully create it's type.
Else only one exception is thrown for the first not working resolve? Could you instead throw an Aggregate exception for all not working registrations?
Else only one exception is thrown for the first not working resolve? Could you instead throw an Aggregate exception for all not working registrations?
Done 🚀
Add a
Validate()
method to theIIocContainer
that can be called from a test and checks if all registered types in the given installers can be resolved.