Effort unit testing Entity framework 6.1.3 DB-first

不想你离开。 提交于 2019-12-03 23:54:54

A colleague of mine found the solution to my issue!

Apparently I was using the "Effort" nuget package instead of the "Effort.EF6" nuget package. After uninstalling and installing the other I also had to update my App.Config with the tags:

  <system.data>
    <DbProviderFactories>
      <add name="Effort.Provider" invariant="Effort.Provider" description="Effort.Provider" type="Effort.Provider.EffortProviderFactory,Effort" />  
    </DbProviderFactories>
  </system.data>

  <entityFramework>
    <providers>
      <provider invariantName="Effort.Provider" type="Effort.Provider.EffortProviderServices, Effort" />
    </providers>
  </entityFramework>

And I also included a call in the SetUp for my unit tests to register the effort provider:

    [SetUp]
    public void Setup()
    {
        EffortProviderConfiguration.RegisterProvider();
    }

This solved the issue for my. Hopefully it can provide some help to others!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!