maui-unit-testing
CommunityWrite robust .NET MAUI tests with xUnit.
Authordavidortinau
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides guidance on setting up and writing effective unit tests for .NET MAUI applications using the xUnit testing framework, ensuring code quality and maintainability.
Core Features & Use Cases
- xUnit Test Setup: Configure test projects for .NET MAUI with necessary NuGet packages.
- ViewModel Testing: Implement patterns for testing ViewModels, including mocking services.
- Mocking MAUI Services: Strategies for mocking common MAUI interfaces like
ISecureStorageandIConnectivity. - Running Tests: Commands for executing tests locally and with code coverage.
- On-Device Testing: Information on running tests directly on emulators or physical devices.
Quick Start
Set up a new xUnit test project for your .NET MAUI application by creating a class library targeting the appropriate TFM and adding the required xUnit and Moq NuGet packages.
Dependency Matrix
Required Modules
xunitxunit.runner.visualstudioMicrosoft.NET.Test.Sdkcoverlet.collectorMoq
Components
scriptsreferences
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: maui-unit-testing Download link: https://github.com/davidortinau/maui-skills/archive/main.zip#maui-unit-testing Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.