Wednesday 18 August 2010

ADO.NET Mocking Context Generator: Visual Studio 2010 Template

In my previous article, I discussed how to put together a Visual Studio 2010 Template to provide Maintenance-free Mocking for Unit Testing in Entity Framework 4.0.

The template is available for download from Microsoft, here.

You can also download it using Visual Studio 2010, by selecting Online Templates from the Add New Item dialog.

How to Use

Just like any other Entity Framework Artifact Generator, after installing:
  • Open your Entity Framework Model (EDMX) file
  • Right click the background and press Properties
  • Set Code Generation Strategy to None.
  • Right click the background again, and select Add Code Generation Item
  • From the Add New Item dialog, select ADO.NET Mocking Context Generator

    At some point I might extend this page to include a brief guide to unit testing. Until then, Julie Lerman's Blog is a good resource, along with the ADO.NET Team Blog.



  • No comments:

    Post a Comment