Base solution for your next web application
Open Closed

First steps #1578


User avatar
0
benjamim created

I did all the steps in this tutorial, but the result is always returning zero records.

<a class="postlink" href="https://www.aspnetzero.com/Documents/Developing-Step-By-Step-MPA">https://www.aspnetzero.com/Documents/De ... y-Step-MPA</a>


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

    Hi,

    By default AspNet Zero unit tests does not get data from database, if you haven't do something special for your project. Data for unit tests are stored in memory by Effort library.

    First you have to insert some data with a repository, appService or UsingDbContext then you should try to get data by using _personAppService.

    You can take a look at Should_Get_Audit_Logs test in AspNet Zero project template. You can also take a look at this article <a class="postlink" href="http://www.codeproject.com/Articles/871786/Unit-testing-in-Csharp-using-xUnit-Entity-Framewor">http://www.codeproject.com/Articles/871 ... y-Framewor</a>

    Please let me know if you have any problems.

  • User Avatar
    0
    benjamim created

    WORK!!!