dotnet-testing-autodata-xunit-integration

Generate .NET test data by integrating AutoFixture with xUnit theories.

28|4|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autodata-xunit-integration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-testing-autodata-xunit-integration
Source: https://github.com/kevintsengtw/dotnet-testing-agent-skills/tree/main/skills/dotnet-testing-autodata-xunit-integration
Command: npx skills add https://github.com/kevintsengtw/dotnet-testing-agent-skills --skill dotnet-testing-autodata-xunit-integration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates test data generation for .NET unit tests by integrating AutoFixture with xUnit to reduce boilerplate and improve test reliability.

Core Features & Use Cases

  • AutoData-driven theories: generate parameters automatically for test methods.
  • InlineAutoData, MemberAutoData, CompositeAutoData: mix fixed values, external sources, and combined datasets.
  • CollectionSize: control the size of generated collections for performance and stability.
  • External data sources: support CSV/JSON sources with reusable data sets to drive tests.

Quick Start

Install and apply test data attributes in your test project. Annotate test methods with [AutoData], [InlineAutoData], [MemberAutoData], or [CompositeAutoData], and optionally define custom AutoDataAttributes. Use [CollectionSize(n)] to cap list sizes. Create CSV/JSON sources to feed tests where needed.

Frequently Asked Questions about dotnet-testing-autodata-xunit-integration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate test data automatically for xUnit theories in .NET?

Mix fixed values with generated data in xUnit by annotating methods with [InlineAutoData] or [MemberAutoData]. These attributes combine hardcoded inputs with AutoFixture-generated parameters to satisfy complex testing scenarios.

Can I use external CSV or JSON sources to drive AutoFixture test data?

Use external CSV or JSON sources to drive AutoFixture test data by creating custom data attributes and composite data sources. This feeds reusable datasets directly into xUnit theories for complex scenarios.

How do I control the collection size of generated lists in AutoFixture tests?

Control the collection size of generated lists in AutoFixture tests by applying the [CollectionSize(n)] attribute. This caps list sizes to ensure test performance and stability.

What is the best way to combine multiple data sources for xUnit parameterized tests?

Combine multiple data sources for xUnit parameterized tests using [CompositeAutoData]. This attribute merges internal and external datasets, creating composite data sources for complex testing scenarios.

Does AutoFixture integration support creating custom AutoData attributes for .NET unit tests?

AutoFixture integration supports creating custom AutoData attributes for .NET unit tests. You can define custom attributes to generate deterministic, reusable data tailored to specific external sources.