Can Autofac inject dependencies into my test class?
Consider the test class (I've kept the example generic as I'll use whatever framework gives me this capability).
public class SimpleTest {
private IService _service;
public SimpleTest(IService service)
{
_service = service;
}
public void TestMethod() {
{
// do something with service
}
}
That IService type is provided by autofac. So now when I run my test method I want various dependencies coming from autofac to have been injected. I don't mind if it has to use field injection - I can make them public if necessary.
Maybe there is some kind of test runner I can register that can do this "preconfiguration"?