Ways of unit testing data access layer

前端 未结 3 543
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-28 08:26

I have be trying to look for an effective way in unit testing my data access layer in C#. I\'m primary a Java developer and have only used C# for about 6 months, in the past

3条回答
  •  梦毁少年i
    2020-12-28 08:56

    This layer's job is to connect the code to the database. It has to encapsulate the knowledge about db connection and syntax. In usually maps the domain language to database language. I look at this part of the unit tests as integration test, and as such I test that the database schema is equivalent against real or test database. More on the subject here.

提交回复
热议问题