Unit Testing while using Entity Framework

I have been recommended to use Entity Framework (EF) instead of LINQ to SQL while building .NET applications. So I pulled out some reference materials, learned the beginning concepts of EF, and started to build an application.

Then I started trying to figure out how to do Unit Testing and Test Driven Development (TDD) while using EF.  What I had read about EF showed me how to build a SQL Server database and then have Visual Studio build the entities for me. I had to design the entire database first and then leave all the classes tied to the database, both of which are incompatible with TDD and Unit Testing.

So I started my Google search, and these are the documents I found really helpful. In the end, Unit Testing and TDD are compatible with EF!  Here is where my journey took me:

TDD and ADO.NET Entity Framework
This late 2008 posting has several people sharing their concerns about using TDD with EF, which is where I was yesterday morning.

Walkthrough: POCO Template for the Entity Framework
Feature CTP Walkthrough: POCO Templates for the Entity Framework
These articles shows how to use the  ADO.NET C# POCO Entity Generator and the Microsoft ADO.NET Entity Framework Feature Community Technology Preview 3 assembly to separate a .edmx Entity Framework file into two groups of classes: the persistence ignorant entity classes (not connected to the database), and the data context class which talks with the database.

Feature CTP Walkthrough: Code Only for the Entity Framework (Updated)

This posting illustrates how to build an EF from code only, without using Visual Studio’s automated generators.  In this process, they were able to keep the persistence ignorant entity classes separate from the database context classes.  This technique required the Microsoft ADO.NET Entity Framework Feature Community Technology Preview 3 assembly.
These articles illustrate how to practically use TDD and EF together!
Now I feel prepared to move forward using Entity Framework together with Test Driven Development methodologies!

99 thoughts on “Unit Testing while using Entity Framework

  1. Pingback: first rate auto
  2. Pingback: description
  3. Pingback: bet365 bonus code
  4. Pingback: buy xanax online
  5. Pingback: Online Sex Store
  6. Pingback: Movers in Atlanta
  7. Pingback: blockchain
  8. Pingback: ¤j¦ë¤p¶Ç
  9. Pingback: 2019 two piece
  10. Pingback: 123movies.pics
  11. Pingback: led displays
  12. Pingback: lebanon news
  13. Pingback: Foot Scrub Brush
  14. Pingback: 바카라사이트
  15. Pingback: 해외축구중계
  16. Pingback: 온라인카지노
  17. Pingback: 바카라
  18. Pingback: 바카라
  19. Pingback: 안전바카라
  20. Pingback: depedtambayan
  21. Pingback: sports relay
  22. Pingback: 온라인카지노
  23. Pingback: we-b-tv.com
  24. Pingback: hs;br
  25. Pingback: tureckie_serialy
  26. Pingback: serialy
  27. Pingback: 00-tv.com
  28. Pingback: +1+
  29. Pingback: watch
  30. Pingback: ++++++
  31. Pingback: HD-720
  32. Pingback: 2020
  33. Pingback: Video
  34. Pingback: wwin-tv.com
  35. Pingback: movies
  36. Pingback: movies online
  37. Pingback: karan johar
  38. Pingback: Top Movies
  39. Pingback: Movies1
  40. Pingback: 11 10 2019
  41. Pingback: Serial smotret
  42. Pingback: kinokrad
  43. Pingback: kinokrad 2020
  44. Pingback: Watch TV Shows
  45. Pingback: casino
  46. Pingback: serial 1
  47. Pingback: serial
  48. Pingback: youtube2019.ru
  49. Pingback: 1 seriya
  50. Pingback: topedstoreusa.com
  51. Pingback: hqcialismht.com
  52. Pingback: myonlinebuy.us
  53. Pingback: lindamedic.com
  54. Pingback: ciaonlinebuy.us
  55. Pingback: See-Season-1
  56. Pingback: genfio.com
  57. Pingback: fioricet2020.com
  58. Pingback: 1plus1tv
  59. Pingback: #1plus1
  60. Pingback: Film 2020

Leave a Reply

Your email address will not be published. Required fields are marked *