<<Download>> Download Microsoft Word Course Outline Icon Word Version Download PDF Course Outline Icon PDF Version

Updated June 2026

Test-Driven Development with .NET MAUI

Class Duration

35 hours of live training delivered over 5 days.

Student Prerequisites

  • Professional C# programming experience
  • Familiarity with Git
  • No prior mobile, XAML, or testing experience required

Target Audience

C# developers and teams who want to learn .NET MAUI the test-first way. This course covers the same full curriculum as our Build Cross-Platform Apps with .NET MAUI course - XAML, MVVM, navigation, platform integration, maps, data, and deployment - but every feature is built test-first. Ideal for teams shipping business-critical mobile and desktop apps where regressions are expensive - field tools, data-collection apps, and line-of-business clients - and for organizations that require automated test coverage as part of their delivery pipeline.

Description

This is the complete Build Cross-Platform Apps with .NET MAUI curriculum, taught test-first. Students learn the same .NET 10 MAUI material (XAML and compiled bindings, MVVM with source generators, Shell navigation, platform APIs, maps, offline data, services and authentication, and store deployment) but every feature begins with a failing test. Mobile apps are notoriously hard to test after the fact: platform APIs, navigation, and device state weave through everything, and writing the tests first forces the architecture that makes MAUI apps testable at all. The course moves from red-green-refactor discipline and the MAUI testability architecture through view models, navigation, and platform services driven from failing tests, with device APIs mocked behind clean seams using NSubstitute. Data and services follow: SQLite repositories test-first, offline sync with conflict cases as test cases, in-process test servers, and authentication with faked MSAL. The final day completes the production picture with Appium UI automation on Android 16 and iOS 26, CI/CD pipelines that build and test every platform, coverage and mutation testing, and AI-assisted test generation inside the TDD loop.

Learning Outcomes

  • Practice red-green-refactor fluently and organize xUnit test suites that stay fast and maintainable.
  • Architect MAUI apps for testability from day one: thin views, MVVM view models, DI in MauiProgram, and platform services behind interfaces.
  • Build the full XAML UI stack on top of CommunityToolkit.Mvvm view models driven from failing tests, with compiled bindings and validation rules written test-first.
  • Test Shell navigation (routes, parameters, guards, and modal flows) without launching the app, and build list-heavy UI with CollectionView backed by tested view models.
  • Abstract and mock platform APIs (geolocation, sensors, permissions, camera and media) with NSubstitute for deterministic tests.
  • Apply TDD to local data and services: SQLite repositories, offline sync with conflict cases as test cases, in-process test servers, and authentication with faked MSAL.
  • Automate UI tests with Appium on emulators and devices, include accessibility checks, and decide what belongs at each level of the test pyramid.
  • Build CI pipelines that compile, test, and report on Android and iOS targets, with coverage and mutation testing as honesty checks and AI-assisted test generation inside the TDD loop.

Training Materials

Comprehensive courseware is distributed online at the start of class. All students receive a downloadable MP4 recording of the training.

Software Requirements

.NET 10 SDK, Visual Studio 2026 (Windows) or VS Code with the .NET MAUI extension (Windows or Mac), Android SDK with an emulator, Appium, and Git. A Mac with Xcode is required only for the iOS labs; all other labs run on Windows or Mac.

Training Topics

TDD Foundations

  • Red-green-refactor: the discipline and the payoff
  • Test organization with xUnit: fixtures, theories, and naming
  • Test tooling in Visual Studio 2026 and VS Code with the .NET MAUI extension
  • The test pyramid for mobile apps
  • The economics of fast feedback: what makes suites slow and flaky

Architecting MAUI for Testability

  • The single-project model and app lifecycle through a testing lens
  • Dependency injection in MauiProgram as the seam for testing
  • Thin views, testable view models: where logic belongs
  • Platform services behind interfaces; humble objects at the platform boundary
  • The handler architecture: what it means for what you can and cannot test

XAML, Layouts, and Controls on Tested Foundations

  • Building screens against view models that exist - and are tested - first
  • Layouts and the control catalog: binding-friendly UI composition
  • .NET 10 compiled XAML and global namespaces: the compiler as your first test
  • Resources, markup extensions, and keeping markup logic-free
  • What belongs in XAML vs. what belongs in tested C#

Data Binding and MVVM Test-First

  • Driving CommunityToolkit.Mvvm view models from failing tests
  • Observable properties, relay commands, and CanExecute logic
  • Compiled bindings with x:DataType: compile-time safety on top of tested state
  • Async operations: testing loading states, cancellation, and errors
  • Converters as pure functions under unit test
  • Messaging between view models, verified by tests

Validation Test-First

  • Validation rules as the first failing tests
  • ObservableValidator and data annotations under test
  • Error surfacing through view model state, asserted in tests
  • Async validation, debouncing, and edge cases as test cases
  • Shell structure: flyouts, tabs, and routes through an abstraction
  • Testing route logic, parameters, and returned results
  • Navigation guards and login redirects as test cases
  • Modal flows and deep links under test
  • What stays in thin navigation adapters - and untested by design

Lists and Data-Heavy UI Under Test

  • CollectionView backed by tested list view models
  • Selection, grouping, and incremental loading logic test-first
  • RefreshView flows: testing refresh state and error paths
  • The .NET 10 default CollectionView and CarouselView handlers: trusting the platform, testing your logic

Styling and Theming: Testable vs. Visual

  • What is testable in styling - theme state, visual state logic, trigger conditions
  • Dark mode and AppThemeBinding: testing theme-dependent behavior
  • Visual State Manager logic driven by tested view model state
  • Where automated tests stop and visual review begins

Mocking the Platform

  • Isolation with NSubstitute: mocks, stubs, and fakes
  • Abstracting geolocation, sensors, connectivity, and share
  • Permission flows under test: granted, denied, and degraded paths on Android 16 and iOS 26
  • Faking time, connectivity, and environmental state
  • Test data builders; avoiding over-mocking by testing behavior, not implementation

Camera and Media Behind Seams

  • MediaPicker behind an interface: capture and selection flows as test cases
  • .NET 10 multi-select and compression: verifying media-handling logic without a camera
  • Processing pipelines - resizing, caching, persistence - under unit test
  • Failure paths: cancellation, denied permissions, and storage errors as tests

Maps and Geolocation Under Test

  • Location logic test-first: distance, proximity, and geofencing rules
  • Faking the geolocation API: accuracy, timeouts, and unavailable scenarios
  • Geocoding behind an interface with deterministic fakes
  • Third-party mapping SDK seams: keeping vendor APIs out of your core logic
  • Map pin and route view models under test

TDD for Local Data

  • SQLite repositories test-first
  • In-memory and on-disk test strategies
  • Migrations under test
  • Preferences and SecureStorage behind testable abstractions
  • Data-layer contract tests shared across implementations

Offline Sync: Conflict Cases as Test Cases

  • Offline-first design driven by tests: queued writes and replay
  • Conflict detection and resolution strategies, each as a test case
  • Connectivity transitions: offline, flaky, and restored networks under test
  • Sync state machines verified exhaustively

Remote Services and Auth Under Test

  • Service-layer tests with real HTTP via in-process test servers
  • Resilience behavior under test: retries, timeouts, and circuit breakers
  • Authentication flows with faked MSAL; token storage and refresh contracts
  • Contract tests against API schemas

Accessibility and Localization in Tests

  • Semantic properties asserted in automated tests
  • Accessibility checks in UI automation runs
  • Localization under test: resource coverage and culture-aware formatting
  • Pseudo-localization as an early-warning test technique

Integration and Device Testing

  • Integration tests across service and data layers
  • Running test suites on emulators and devices
  • Automated UI testing with Appium: selectors, waits, and stability
  • What belongs in UI tests - and what does not
  • Release-build realities: trimming and NativeAOT on iOS verified before the store does it for you

CI/CD for Tested MAUI Apps

  • Pipelines that build and test Android 16 and iOS 26 targets
  • Emulator strategies and device farms in CI
  • Test results as release gates
  • Telemetry in test and production: Aspire service defaults and OpenTelemetry

Coverage, Mutation, and AI-Assisted Testing

  • Coverage reporting: what it tells you and what it hides
  • Mutation testing as the honesty check on your suite
  • Generating tests with AI coding assistants - within the TDD loop
  • Reviewing AI-generated tests for real assertions
  • Coverage-gap analysis with AI tools
<<Download>> Download Microsoft Word Course Outline Icon Word Version Download PDF Course Outline Icon PDF Version