title: Unit test over Autofac Module to reach 100% code coverage
body: <p>We have a core library which make complex calculations and we consider it critical and we want to have a code coverage of 100% on that library. We now have 96% which is great, but we cant get the 100% because of this class:</p>
  
  <pre><code>public class IoCModule : Autofac.Module
  {
      protected override void Load(Autofac.ContainerBuilder builder)
      {
          builder.RegisterType&lt;SomeMathServiceA&gt;().As&lt;ISomeMathServiceA&gt;();
          builder.RegisterType&lt;SomeMathServiceB&gt;().As&lt;ISomeMathServiceB&gt;(); 
  
          //... more registrations
      }
   }
  </code></pre>
  
  <p>I dont know how to test it, or if we really need to test it.</p>
  
  <p>I have tried a unit test that take this module and create an <code>IContainer</code> and resolves every register dependency but some services access DB and config files which are very complex to mock in this context.</p>
  
  <p>Done!!!!
  <a href="https://i.stack.imgur.com/v9K9K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v9K9K.png" alt="enter image description here"></a></p>