~/talk

Simplified Unit Testing with the Entity Framework Core InMemory Provider

Talkat NDC Sydney 2017 · 2017-08-14..08-18· [databases, testing]
slides:none on file

Advocates using the EF Core InMemory provider to replace mocks so tests new up a real DbContext, seed six customers, and assert behavior; one demo has 12 controller tests with 11 failing until each test uses a unique database name via Guid.NewGuid().ToString() and calls database.EnsureCreated then database.EnsureDeleted to clean up. A reusable NorthwindTestBase centralizes context setup. Beware limitations: the in‑memory store is not relational so referential constraints aren’t enforced and these are closer to lightweight integration tests than provider‑specific integration tests.

AI-written summary · about

  1. 0:00Introduction
  2. 1:07The typical approach
  3. 2:25The simplified approach
  4. 4:09In-memory provider demo
  5. 7:23Web API testing demo
  6. 9:40Using a test base class
  7. 11:05Limitations and concerns
  8. 13:11Resources and summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.