Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
9 posts found
Integration Testing Infrastructure in .NET 10: What Runs Real and What Is Faked?
Testing & Quality PART 01

Integration Testing Infrastructure in .NET 10: What Runs Real and What Is Faked?

In this series an integration test runs the API inside the test process with its production pipeline and the database as a real SQL Server container; only external services such as payment, shipping and email are faked at the boundary. We show with real runs how SQLite and InMemory differ in collation, length, precision and transactions, then set up an xUnit v3 + Testcontainers skeleton kept apart from unit tests.

14 Nov 2026 15 min 1
WebApplicationFactory in Depth: Custom Factory, ConfigureTestServices, Configuration and Test Authentication
Testing & Quality PART 02

WebApplicationFactory in Depth: Custom Factory, ConfigureTestServices, Configuration and Test Authentication

Pass test configuration with UseSetting or CreateHost; a value given with ConfigureAppConfiguration never reaches what Program.cs reads before Build. With measurements we show replacing services in a custom factory, telling 401 from 403 with a header-based test authentication handler, redirect and ProblemDetails helpers, the real cost of WithWebHostBuilder, and background services running in tests by accident.

14 Nov 2026 13 min 1
Real SQL Server with Testcontainers: Container Lifecycle, Migrations and Cleanup Between Tests
Testing & Quality PART 03

Real SQL Server with Testcontainers: Container Lifecycle, Migrations and Cleanup Between Tests

Start the SQL Server container once per assembly, open a separate database per test class, build the schema with migrations rather than EnsureCreated, and clean up with Respawn before every test. We measure transaction rollback, a database per test and Respawn on a shared database with the same ten tests, and show that rollback silently does nothing without PreserveExecutionContext and what container reuse really costs.

14 Nov 2026 12 min 1
Faking External Dependencies at the Boundary: WireMock.Net, Fake SMTP, FakeTimeProvider and Failure Scenarios
Testing & Quality PART 04

Faking External Dependencies at the Boundary: WireMock.Net, Fake SMTP, FakeTimeProvider and Failure Scenarios

Fake external services at the HTTP and SMTP boundary rather than by mocking your own client: WireMock.Net for the payment and shipping APIs, Mailpit for email, FakeTimeProvider for time. With real runs we show verifying the outgoing request, retry, timeout and circuit breaker really kicking in, POST retries against a slow provider turning into four payments, and a global fake clock freezing Polly.

14 Nov 2026 11 min 1
The Contract Between Angular and the API: OpenAPI Documents, Breaking Change Detection and When to Use Pact
Testing & Quality PART 05

The Contract Between Angular and the API: OpenAPI Documents, Breaking Change Detection and When to Use Pact

The contract between Angular and the API is carried by an OpenAPI 3.1 document generated at build time and committed; in CI, oasdiff catches breaking changes, while TypeScript types generated from the document and tsc catch breakage in the fields actually used. With real output we explain why the document shows numbers as 'integer or string', the enum, nullable and required pitfalls, how to classify breaking changes and when Pact is needed.

14 Nov 2026 11 min 1
Getting Started with Playwright: Playwright Test or Playwright for .NET, Locators, Auto-Waiting and Trace Viewer
Testing & Quality PART 06

Getting Started with Playwright: Playwright Test or Playwright for .NET, Locators, Auto-Waiting and Trace Viewer

Playwright waits for the element before an action but not for the action's result; leave the result to web-first assertions built with expect(locator). For a .NET + Angular team we compare Playwright Test with Microsoft.Playwright and show with real runs how to write locators from the user's point of view with getByRole and getByLabel, strict mode, codegen, and reading a failed test in the trace viewer.

14 Nov 2026 14 min 1
End-to-End Testing Bookstore: Bringing Up the API, Angular and the Database Together
Testing & Quality PART 07

End-to-End Testing Bookstore: Bringing Up the API, Angular and the Database Together

Playwright's webServer starts two processes: a .NET host that opens the SQL Server container and runs the API on a real port with WebApplicationFactory.UseKestrel, and ng serve. With real runs we show three surprises in the host, signing in once with a setup project and storageState, preparing test data through the API, combining page objects with fixtures, and UseKestrel ignoring the port with WithWebHostBuilder.

14 Nov 2026 16 min 1
Flaky E2E Tests: Isolation, Parallelism, Retries, Network Mocking and Visual Comparison
Testing & Quality PART 08

Flaky E2E Tests: Isolation, Parallelism, Retries, Network Mocking and Visual Comparison

A flaky E2E test often points to real nondeterminism in the application: Bookstore's search test was catching a race in which a late HTTP response overwrote the result. With real runs we cover shared data, time zones, page.clock, workers and sharding, the failures retries hide, legitimate uses of page.route, platform differences in toHaveScreenshot and accessibility checks with axe.

14 Nov 2026 14 min 1
Reading Old Integration and E2E Tests: WebApplicationFactory from .NET 6 to 11, Testcontainers 3 to 4, Protractor to Playwright
Testing & Quality PART 09

Reading Old Integration and E2E Tests: WebApplicationFactory from .NET 6 to 11, Testcontainers 3 to 4, Protractor to Playwright

When reading an old integration test, the first question is which application the factory brings up: a Startup-based factory can compile on .NET 10 and return 404 without ever running Bookstore. With real builds and runs we cover how WebApplicationFactory changed from .NET 6 to 11, .NET 11's ConfigureWebApplicationBuilder hook, the Testcontainers 4 changes, moving off Protractor, and the breaking changes in Playwright 1.58–1.65.

14 Nov 2026 11 min 1
Blog Map