Base solution for your next web application
Open Closed

Default unit tests are not working #1650


User avatar
0
pkut created

Hello,

I'm trying to run 4 unit tests that was automatically generated for empty project. When I'm trying to debug it I got "SQL server is not accessible" error inside DbContext constructor. Debugging it I can see that DbContext constructor receives connection that is instance of "Effort.ProviderEffortConnection" - seems to be ok. But anyway later I got the error above- it looks like something is trying to create real DBContext instead of Effort. When I put connection string to the App.config, I got "database not initialized" error or something like this. What should I do, maybe some little setting was missed? Thank you in advance.


2 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    It's strange. It's working for us. Is it for only debugging unit tests or happening also directly running tests? If you are sure, please create an issue here to follow it: <a class="postlink" href="https://github.com/aspnetboilerplate/module-zero-template/issues/new">https://github.com/aspnetboilerplate/mo ... issues/new</a>

  • User Avatar
    0
    pkut created

    Hello,

    Sorry for bothering you, but we solved the problem. Actually we have changed database initializer when trying to deploy to Azure and this was very critical for unit tests. Setting up default initializer in the unit test project solves the problem. Thank you very much for so interesting framework.

    Best regards