lundi 18 février 2019

Data preparation for Unit test - C#

I am writing unit test/Component test using Entity Framework Core InMemory Provider.

When I write unit test, I came across with the following question.

I have the following two BL/DL methods.

  1. ToCreate
  2. ToGet

So when I write a unit test, I need to create some sample data for the unit test.

When I write a unit test for ToGet method, can I use ToCreate (BL method) to create sample data or When I write a unit test for ToCreate, Can I use ToGet method to check the created data? Is that a correct choice?

Referred the following to create a unit test: https://www.youtube.com/watch?v=ddrR440JtiA

Aucun commentaire:

Enregistrer un commentaire