dotnet-testing-autofixture-bogus-integration

Generate realistic .NET test data by integrating AutoFixture with Bogus.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill integrates AutoFixture with Bogus to generate realistic test data, reducing setup time and boilerplate while producing consistent, semantic data for unit and integration tests.

Core Features & Use Cases

  • Seamless Bogus-powered data within AutoFixture for realistic properties
  • Support for circular references via OmitOnRecursionBehavior
  • Type-level and property-level customization for tailored data
  • Ready-made patterns for test factories, data factories, and AutoData integration
  • Useful for .NET projects using xUnit and AutoFixture to drive comprehensive tests

Quick Start

  • Install packages: dotnet add package AutoFixture; dotnet add package Bogus
  • Create fixture: var fixture = new Fixture().WithBogus(); var user = fixture.Create<User>()
  • Use with BogusAutoDataAttribute in xUnit tests

Frequently Asked Questions about dotnet-testing-autofixture-bogus-integration

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

FAQPage Schema
How do I generate realistic test data in C# using AutoFixture and Bogus together?

To generate realistic test data, you integrate AutoFixture with Bogus by calling new Fixture().WithBogus(). This applies Bogus semantic data generation within AutoFixture fixture creation, reducing boilerplate for your xUnit tests.

How does AutoFixture handle circular references when generating complex object graphs?

AutoFixture handles circular references in complex object graphs by applying OmitOnRecursionBehavior. This mechanism safely stops infinite recursion by omitting properties that cause cycles, allowing test data generation to complete without stack overflow errors.

Can I customize test data generation at the property level in .NET unit tests?

Yes, you can customize test data generation at both type and property levels. Integrating AutoFixture with Bogus allows you to tailor specific properties with realistic data rules while using BogusAutoDataAttribute to drive xUnit tests.

Does this Bogus and AutoFixture integration support seed control for consistent unit tests?

Yes, the AutoFixture and Bogus integration supports seed control to ensure consistent test data. By setting specific seeds in Bogus, you generate deterministic data across test runs, which is crucial for reliable unit and integration testing outcomes.

What is the best way to create test factories for complex POCOs in xUnit?

The best way to create test factories for complex POCOs in xUnit is using AutoFixture combined with Bogus. This approach provides ready-made patterns for data factories, automatically generating realistic semantic data for simple objects and complex graphs.