LightInject icon indicating copy to clipboard operation
LightInject copied to clipboard

LightInject.xunit, composition

Open vegar opened this issue 11 years ago • 1 comments
trafficstars

LightInject will look for an ICompositionRoot implementation in the same assembly as the requested service. [...] If such an implementation does not exists or that we for some other reason need to configure the container, we can do this by simply implementing a static method in the test class [...]

I seldom have my composition root in the same assembly as the service. I also wouldn't like to declare the Configure-method in every testclass. Wouldn't a ICompositionRoot in the test assembly be a better way of configure the container?

vegar avatar Sep 05 '14 07:09 vegar

Good idea. It could search for an ICompositionRoot implementation in the test assembly. If it is found, we execute it.

seesharper avatar Sep 10 '14 07:09 seesharper