Last post Jul 04, 2017 11:33 AM by tapan2017
Jul 03, 2017 05:33 PM|tapan2017|LINK
we use EF to do CRUD operation. now tell me how could i unit test of those code without insert/ update data in db?
anything new as such has been added in EF core for unit test which help us to generate unit test code easily instead of manually writing code?
Jul 04, 2017 10:19 AM|AngelinaJolie|LINK
I guess that this is what you actually need.
Please refer to this article :
'When writing tests for your application it is often desirable to avoid hitting the database. Entity Framework allows you to achieve this by creating a context – with behavior defined by your tests – that makes use of in-memory data.' From
And it uses a mocking framework ;
Jul 04, 2017 11:33 AM|tapan2017|LINK
thanks for pushing me to right direction. just like to know that do i need to write a repository on top of EF crud operation for unit testing? is it mandatory to write repository.