Small testing library for autofac modules
- Create TestContainerBuilder
- Register autofac modules
- Register mocks (NSubstitute or Moq)
- Resolve test services
[TestMethod]
public void ExampleTest()
{
// arrange
new TestContainerBuilder()
.Module<TestModule>()
.Mock(out IBar bar)
.Resolve(out IFoo underTest);
bar.Value().Returns(2);
// act
var actual = underTest.Add(1);
// assert
Assert.AreEqual(3, actual);
}