Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Running unit tests when TargetFramework is 4.6.1 #3485


User avatar
0
SperseDev created

Hi!

We have updated our project template to latest (ASP.NET Core & Angular v4.1.3), but have some problem with running unit tests.

We have found related issue #288 and fix

<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/288">https://github.com/aspnetzero/aspnet-ze ... issues/288</a> <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/commit/3eecf4758b79f020fb6950b4772b4b1efa6262ef">https://github.com/aspnetzero/aspnet-ze ... 1efa6262ef</a>

but it not fully resolve our issue. Now We receive another exception:

Message: System.NotSupportedException : SQLite does not support schemas. For more information, see <a class="postlink" href="http://go.microsoft.com/fwlink/?LinkId=723262">http://go.microsoft.com/fwlink/?LinkId=723262</a>

Yes, We have db tables/entities with not default schema dbo.

Any ideas how to fix this?

Thanks


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We didn't know that. You can change back to EF In-Memory or another In-Memory DB that supports multiple schemas. If you know any of then, we are open to suggestions.

    Thanks.

  • User Avatar
    0
    SperseDev created

    What about using LocalDb for auto-tests? Or update DBContext to move schema part to table prefix (if not dbo) when running tests?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    We cannot implement this in a short time but we will definetely consider it for the next release of AspNet Zero.

    Thanks.

  • User Avatar
    0
    artj created

    Hi,

    Is there available a test project version using EF In-Memory instead of sqlite instead that we can download?

    Thanks!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @artj,

    We were using EF In-Memory unit tests but converted to Sqlite with this issue <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/166">https://github.com/aspnetzero/aspnet-ze ... issues/166</a>. If you revert it's changes in your project, you can use EF In-Memory unit tests.