maui-unit-testing

Installation
SKILL.md

MAUI Unit Testing

Use this skill to make MAUI app logic testable without requiring every test to start a device or simulator. Keep UI framework dependencies at the edges.

Workflow

  1. Identify what is being tested: ViewModel, service, navigation abstraction, storage wrapper, platform capability, or UI integration.
  2. For ViewModels and services, create a normal xUnit test project.
  3. Introduce interfaces around platform APIs such as geolocation, preferences, secure storage, media picker, file picker, and navigation.
  4. Use fakes or mocks for those interfaces in unit tests.
  5. Use device/integration tests only for behavior that requires handlers, platform permissions, native controls, or OS services.
  6. If a test or tooling project must reference a MAUI app project, use the AppProjectReference support provided by Microsoft.Maui.Build.AppProjectReference instead of forcing the app project to behave like a normal class library.
Installs
1
GitHub Stars
213
First Seen
4 days ago
maui-unit-testing — dotnet/maui-labs