Earlier I asked this question How to correctly unit test my DAL?, one thing left unanswered for me is if to really test my DAL is to have a Test DB, then what is the role of
The problem could very well be in the original question. Some of the more popular examples of MVC use a shortcut by returning a DbSet
such as:
public class MusicStoreEntities : DbContext
{
public DbSet Albums { get; set; }
public DbSet Genres { get; set; }
public DbSet Artists { get; set; }
public DbSet Carts { get; set; }
public DbSet Orders { get; set; }
public DbSet OrderDetails { get; set; }
}
To me this tightly couples the implementation of persistence which I believe is a bad thing. It woud be better to return List
which could easily be mocked.