Back to feed
Dev.to
Dev.to
7/8/2026
Stop writing a test-data builder for every class in .NET

Stop writing a test-data builder for every class in .NET

Short summary

XModelBuilder is a .NET library that generates fluent test-data builders for any C# class, eliminating the need to write a separate builder per class. It supports deep property paths, indexers, seeded random data via Bogus/Faker integration, and DI-registered per-type defaults. The library also includes an untyped layer for Gherkin table integration, making it useful for BDD-style test scenarios.

  • XModelBuilder provides fluent builders for any C# class without per-class boilerplate
  • Supports deep paths, indexers, seeded fakers, and BuildMany for batch creation
  • Includes untyped layer for Gherkin tables and BDD scenarios

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more