Creates XAML unit tests for GitHub issues in the Controls.Xaml.UnitTests project. Tests XAML parsing, compilation (XamlC), and source generation. Use when testing XAML-specific behavior, not UI interactions.
Quick Install
bunx add-skill dotnet/maui -s write-xaml-tests
Requires .NET SDK for building and running xUnit tests.androiddesktopdotnethacktoberfestiosmaccatalyst
Instructions
Loadingβ¦
Write XAML Tests Skill
Creates XAML unit tests that verify XAML parsing, XamlC compilation, and source generation behavior.
# Build the test project
dotnet build src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj -c Debug --no-restore -v q
# Run specific test
dotnet test src/Controls/tests/Xaml.UnitTests/Controls.Xaml.UnitTests.csproj --filter "FullyQualifiedName~MauiXXXXX" --no-build
Step 4: Verify Test Behavior
For bug reproduction tests: Tests should FAIL before fix, PASS after fix
For regression tests: Tests should PASS to confirm behavior works
Output
After completion, report:
β XAML unit test created for Issue #XXXXX
**Files:**
- `src/Controls/tests/Xaml.UnitTests/Issues/MauiXXXXX.xaml`
- `src/Controls/tests/Xaml.UnitTests/Issues/MauiXXXXX.xaml.cs`
**Test method:** `DescriptiveTestName`
**Inflators tested:** Runtime, XamlC, SourceGen
**Verification:** Tests [PASS/FAIL] as expected
References
Full conventions:.github/instructions/xaml-unittests.instructions.md