Testing Practices
TDD, Arrange-Act-Assert, the test pyramid, test doubles (fakes, stubs, mocks and spies), snapshot testing, database testing, API testing and CI test automation.
-
What is the Arrange-Act-Assert pattern? How do you name unit tests so a failure explains itself, and why should each test check one behaviour?
Covers the Arrange-Act-Assert structure, test naming conventions, the one-behaviour-per-test rule, and how they make xUnit test failures readable.
Beginner
Theory
Testing Practices
Β· π 2 follow-ups
-
What is the difference between a stub and a mock? Explain state verification versus behaviour verification, the classicist and mockist schools, and how that choice affects your .NET tests.
Covers stubs versus mocks, state versus behaviour (interaction) verification, classicist versus mockist TDD, and how each choice shapes NSubstitute-based tests in .NET.
Junior
Theory
Testing Practices
Β· π 3 follow-ups
-
What is test-driven development? Walk me through red-green-refactor, where TDD genuinely helps, where it doesn't, and how you actually use it on a .NET team.
Covers the TDD cycle (red, green, refactor), its design and regression benefits, where it fits poorly, and pragmatic use of TDD on .NET teams.
Intermediate
Theory
Testing Practices
Β· π 2 follow-ups
-
What is the test pyramid, and how does it differ from the testing trophy and the honeycomb? How would you balance unit and integration tests for a typical ASP.NET Core API backed by SQL Server?
Covers the test pyramid, the testing trophy and the microservice honeycomb, and how to choose the mix of unit, integration and end-to-end tests for an ASP.NET Core API.
Intermediate
Theory
Testing Practices
Β· π 3 follow-ups
-
How do you use snapshot testing with Verify in a .NET project? Show how you snapshot an API response, scrub volatile values like ids and timestamps, and handle accepting changes in CI.
Covers Verify snapshot testing in xUnit: received and verified files, snapshotting API responses, scrubbing volatile data, global settings and the review workflow in CI.
Mid-Level
Coding
Testing Practices
Β· π 2 follow-ups Β· π 1 real-world
-
How do you test EF Core data access against a database? Compare the EF Core in-memory provider, SQLite and a real SQL Server in a container, and explain how you reset state between tests with Respawn or transactions.
Covers the options for database testing with EF Core (in-memory provider, SQLite, SQL Server via Testcontainers), their fidelity gaps, and resetting state with Respawn, transaction rollback or per-test databases.
Mid-Level
Theory
Testing Practices
Β· π 3 follow-ups Β· π 1 real-world
-
What is over-mocking? Explain the difference between testing behaviour and testing implementation details, why mock-heavy tests break when you refactor, and how you would fix a suite like that.
Covers over-mocking, behaviour versus implementation-detail tests, why interaction-heavy tests are brittle under refactoring, and practical ways to move a .NET suite towards behaviour-focused tests.
Mid-Level
Theory
Testing Practices
Β· π 3 follow-ups Β· π 1 real-world
-
Your .NET solution's CI test stage has grown to 35 minutes and developers are batching changes to avoid it. How would you redesign the test suite and pipeline so pull requests get fast feedback without losing confidence? Cover parallelism, test splitting, containers and what runs on every PR versus later.
Covers making a .NET test suite fast in CI: measuring where time goes, xUnit parallelism, sharding across agents, container reuse, test selection, and deciding what runs on every PR, on merge and nightly.
Senior
Architecture
Testing Practices
Β· π 3 follow-ups Β· π 1 real-world