I have a test class with a constructor that needs an IService.
public class ConsumerTests
{
private readonly IService
There is a way to do this using nuget package out of this source code: https://github.com/dennisroche/xunit.ioc.autofac
It works great as long as you use [Fact]
, but then I got blocked when started using [Theory]
. There is a pull request to sort this out.
To unblock myself, I used CollectionFixture to inject Container and from the container, I resolve the Interface.