简体   繁体   中英

Advantages of using EF core in memory database provider for unit testing of asp.net core application

Is entity framework core in memory database provider replace moq ? What should i use for unit testing in my asp.net core application. I am using asp.net core mvc and ef core 2.0.

In memory database is not a replacement of MOQ ; both are two different features.

MOQ is used for mocking the 3rd party objects or objects beyond the scope of unit test so that unit tests can be written for well effective smaller unit.

While In memory database is used to validate the data access APIs against the data which one arrange for a unit test. It is designed for testing purposes only.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM