Unable to determine the provider name for connection of type 'myNamespace.FakeDbConnection'

Oct 5, 2012 at 8:03 PM

I have tried to adapt this to a C# EF 5 code-first scenario.  When my unit tests hits my DbContext for a DbSet-backed property, a NotSupportedException is thrown with the following message:

Unable to determine the provider name for connection of type 'myNamespace.FakeDbConnection'

Do you have any guidance on how to proceed or what might be causing the problem?

 

--rick

Jun 16, 2014 at 9:16 PM
Any update to this? I'm trying to use this to test linq-to-entities via disconnected unit tests using EF6 and am receiving the same issue. All the documentation on recommended practices for unit testing EF6 is to use mocking or test doubles which query via linq-to-objects thus not property validating the queries written within the application.
  • Tim
Jun 17, 2014 at 3:40 PM
I never got an answer on this, and never found a satisfactory solution, so I moved on. The validation of queries like you are suggesting is a bit of a blind spot in our unit test suite.

Good luck.

--rick



Coordinator
Jun 17, 2014 at 9:06 PM
I never moved forward on this project due to time constraints. I would reccomend looking at Effort (https://effort.codeplex.com/) which is a much more mature version of the same concept as this project.
Jul 7, 2014 at 3:09 AM
Thank you both for your responses. Effort is more than I need for my unit-testing setup. As such, I've forked this and converted it to C# (just because that is what I use and am more familiar with) and updated to work with EF6 based on the custom provider changes.