dotnet 8/3/2017 Entity Framework Mocking DbSet for Sync and Async Queries in Moq When building a test framework it is sometimes useful to be able to write test code against DbSet<T> objects. Since DbSet<T> implements IDbSet<T> it is relatively easy to wire up a mock for your entity. Before we jump in let’s go over an important concept in the Moq framework.