Hi,
I want to test my insert command before the data going to insert on database by using unit test.
i am new to the unit test.can any one help try to help me.
Thank you...
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Bhuvanesh MohankumarRank #310 · 8.1K reputationPosted Apr 29, 2016, 3:56 AM EDT
Good, you can create a repository layer & Data Access layer and mock the database objects, so it will unit test all codes.
Once it goes to data access layer then your mock will return the values you provided in setup.