Open Closed

ABP generated module sample test case getting repository null #8160


User avatar
0
Karunakar created
  • ABP Framework version: latest
  • UI Type: Angular
  • Database System: EF Core (MySQL.)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:Plesae provide a sample project that having sample test case to check the appservice with sample data
  • Steps to reproduce the issue: *Create a module using ABP studio that module can also contain test project. *Write a test case to check the Appservice present in application project. *Write test case with using test Data that need to verify weather the service is working fine or not. *Repository needs to show the nserted test records. *After redirected to AppService while debugging the respository still show the inserted test records.
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

16 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you share your project to liming.ma@volosoft.com ?

    I will download and check it.

    Thanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    email sent please check and update

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    May be due to permission violation issues you didnt receive the project if not. Please provide a sample project download the module from studio that module cant execute without microservice. After download write a service in appservice project and try to test it by writing sample test cast with test data. When i hit the app service while testing i want to get the repository data to show in app service

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I have downloaded your project, I will check it asap.

    THanks.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    I am trying with this from last 3 days i need to submit this today, could you please spent some time and please reply ASAP. Thanks!

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Why do you add these services as null mocks?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    If not added then getting autofac exception

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    please suggest the correct process

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    The template project already contains some test codes; please refer to them.

    They are under the Samples folder.

    and the test document: https://abp.io/docs/latest/tutorials/book-store?UI=NG&DB=EF https://abp.io/docs/latest/tutorials/book-store/part-04?UI=NG&DB=EF

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You are using the wrong way to unit test, you do not need to mock any application services, domain managers and repositories.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    I suggest you follow this document

    https://abp.io/docs/latest/tutorials/book-store?UI=NG&DB=EF https://abp.io/docs/latest/tutorials/book-store/part-04?UI=NG&DB=EF

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    If you seen I followed the same but still getting my repository getting null in reository_tests after test data seeded. If you had some free time we can connect for a while

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    or else could you please share my project by correct it how exactly we need to write?

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You have set a random tenantid for your entities.

    they why you can't query them. because https://abp.io/docs/latest/framework/infrastructure/data-filtering

    we have source code for the sample https://github.com/abpframework/abp-samples/tree/master/BookStore-Mvc-EfCore

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    Karunakar created

    Now, evertything working fine many thanks!.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.