Skip to content
Entity Framework 6 Test Doubles project, lifted directly from Microsoft EF6 repo and gathered into a buildable project
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Properties
Utilities
.gitignore
App.config
IdleOxen.TestDoubles.EntityFramework.csproj
InMemoryAsyncQueryProvider.cs
InMemoryAsyncQueryable.cs
InMemoryDbAsyncEnumerator.cs
InMemoryDbSet.cs
InMemoryNonGenericDbSet.cs
InMemoryNonGenericSqlQuery.cs
InMemorySqlQuery.cs
README.md
packages.config

README.md

EF6TestDoubles

Entity Framework 6 Test Doubles project, lifted directly from Microsoft EF6 repo and gathered into a buildable project

I've just copied the relevant files across into a single project so it can be referenced and used in unit tests I haven't changed the MS code in any substantial way. I've just added some comments to stop ReSharper whinging

Just...

  • Create an interface for your DbContext that exposes your IDbSets
  • Create an InMemoryDbSet for your IDbSets in your test class & initialize it with your test data
  • Set up a mock context that returns your InMemoryDbSet
  • Bob's your uncle
You can’t perform that action at this time.