I remember having some issues with error messages not corresponding to the actual issue. If you can make sure of all of these (assuming you are following Helix principles here):
Declare databases configuration on each projects
(ex : Feature/YourFeautre/App_Config/Include/Feature/Sitecore.license.config)
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<databases>
<database id="core">
<patch:attribute name="type">Sitecore.Data.DefaultDatabase, Sitecore.Kernel</patch:attribute>
</database>
<database id="master">
<patch:attribute name="type">Sitecore.Data.DefaultDatabase, Sitecore.Kernel</patch:attribute>
</database>
<database id="web">
<patch:attribute name="type">Sitecore.Data.DefaultDatabase, Sitecore.Kernel</patch:attribute>
</database>
</databases>
<!-- EVENTING -->
<eventing defaultProvider="sitecore">
<providers>
<clear />
<add name="sitecore" type="Sitecore.Eventing.EventProvider, Sitecore.Kernel" systemDatabaseName="core" />
</providers>
</eventing>
</sitecore>
Declare the license configuration on each projects.(ex : Feature/YourFeautre/App_Config/Include/Feature/Sitecore.license.config)
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="LicenseFile" value="C:\inetpub\wwwroot\yourInstance\App_Data\license.xml" />
</settings>
</sitecore>
</configuration>
Then in your tests, you should be using these :
using Sitecore.Data;
using Sitecore.FakeDb;
using Sitecore.Mvc.Presentation;
using Xunit;
In your projects references, you should have those :
Official doc said you need those :
Lucene.Net.dll
Sitecore.Analytics.dll
Sitecore.Kernel.dll
Sitecore.Logging.dll
Sitecore.Nexus.dll
But I make it work without Sitecore.Analytics.dll and Sitecore.Logging.dll
After it is all said and done, make sure you are using compatible versions within your projects. I think your Microsoft.Extensions.DependencyInjection is good, would also make sure to have Microsoft.Extensions.DependencyInjection.Abstractions in your references. So within your packages.config it should look like this :
<?xml version="1.0" encoding="utf-8"?>
<packages>
<!-- [...your other packages...] -->
<package id="Microsoft.Extensions.DependencyInjection" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="1.0.0" targetFramework="net452" />
</packages>
I would also recommend to take a look at this answer : https://stackoverflow.com/questions/39802162/what-is-the-minimum-nugets-footprint-for-sitecore-fakedb-tests/39802163 because it feels like, in your similar case, you would end up using this fakedb version :
<package id="Sitecore.FakeDb" version="1.2.2" targetFramework="net452" />
and also include sitecore.logging
<package id="Sitecore.Logging.NoReferences" version="8.2.160729" targetFramework="net452" developmentDependency="true" />