Bogus
Fake data generator for .NET — port of Faker.js that generates realistic test data for C# and F# projects. Bogus features: Faker<T> typed generators with RuleFor(), fluent API, locale support (30+ languages), seeded generation for reproducible test data, built-in generators (Name, Address, Internet, Phone, Lorem, Date, Finance, Commerce, Company, Vehicle), and AutoFaker for automatic property population. `new Faker<Agent>().RuleFor(a => a.Name, f => f.Name.FullName()).Generate()` creates agents with realistic names. Seeding: `new Faker('en').UseSeed(42)` produces deterministic data for snapshot tests. Port of Faker.js with identical API surface. Alternative to manual `new Agent { Name = 'Test' }` boilerplate in agent test suites.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Testing library — no production security concerns. Never use Bogus-generated data in production security contexts (tokens, passwords, API keys). Fake email addresses from Internet.Email() may collide with real email addresses; use unique domain suffix (e.g., @agent-test.invalid) to prevent accidental external communication.
⚡ Reliability
Best When
Your .NET agent test suite needs diverse, realistic test data beyond simple hardcoded strings — Bogus eliminates boilerplate agent fixture creation with readable fluent rules.
Avoid When
You need auto-generated test data for complex domain models without writing rules (use AutoFixture), or you're generating production synthetic data with strict domain constraints.
Use Cases
- • Agent test data generation — new Faker<AgentModel>().RuleFor(a => a.Name, f => f.Commerce.ProductName()).RuleFor(a => a.Email, f => f.Internet.Email()).Generate(10) creates 10 realistic agents for integration tests without manual fixture files
- • Seeded reproducible agent tests — faker.UseSeed(12345) produces same data every run; snapshot tests comparing agent data output pass consistently; seed stored in test comments for reproduction of specific test scenarios
- • Agent API load test data — Enumerable.Range(0,1000).Select(_ => agentFaker.Generate()).ToList() generates 1000 diverse agents for performance testing; realistic data exercises agent search, filtering, and sort code paths
- • Agent fixture builder pattern — AgentFaker extends Faker<Agent> with predefined rules; AgentFaker.AsAdmin() / AgentFaker.AsFreeUser() returns preconfigured agent variants for different agent test scenarios across test suite
- • Locale-aware agent data — new Faker('ja').Name.FullName() generates Japanese names for agent internationalization tests; finance.Amount() generates locale-appropriate currency values for agent billing test scenarios
Not For
- • Production data generation — Bogus generates fake data for testing only; for production realistic synthetic data use proper domain-specific generators with business rules
- • Cryptographically random data — Bogus uses seeded pseudo-random; for security tokens and agent API keys use System.Security.Cryptography.RandomNumberGenerator
- • AutoFixture replacement for complex object graphs — Bogus requires explicit RuleFor definitions; for deeply nested object graph auto-generation without rules use AutoFixture
Interface
Authentication
No auth — local test data generation library.
Pricing
Bogus is MIT licensed. Free for all use.
Agent Metadata
Known Gotchas
- ⚠ Seed must be set before any Generate() call — faker.UseSeed(42) before first Generate() for reproducible data; calling UseSeed() after Generate() doesn't reset state; agent snapshot tests using seeded Bogus must set seed before any faker property access, not after
- ⚠ RuleFor() order affects subsequent rules — f.Random in RuleFor chains shares same Random state; adding new RuleFor() changes data generated by subsequent rules; agent test data that relies on specific Bogus output breaks when new properties added; use explicit index-based seeding or pin test expectations to properties not sequence
- ⚠ StrictMode prevents unset required agent properties — .StrictMode(true) throws if any non-nullable public property lacks RuleFor(); useful for ensuring agent test models are fully populated; off by default so optional properties silently get default(T) unless explicitly set in rules
- ⚠ Generate(n) vs GenerateBetween(min,max) — Generate() with int returns exactly n items; GenerateBetween() returns random count; agent tests expecting exact count should use Generate(n) not GenerateBetween(); mixing up causes flaky assertion on list length
- ⚠ Bogus locales affect all generators — new Faker('fr') changes Name, Address, Phone to French locale but also Date format and Lorem text; agent tests comparing formatted output must account for locale-specific formatting; use explicit locale for each Faker instance in multi-locale agent test suites
- ⚠ Thread safety requires separate Faker instances — sharing single Faker<T> instance across parallel xUnit test classes causes data race in Random state; agent integration tests using xUnit parallelism must create new Faker in each test or use [Collection] to prevent parallel execution of tests sharing faker
Alternatives
Full Evaluation Report
Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for Bogus.
AI-powered analysis · PDF + markdown · Delivered within 30 minutes
Package Brief
Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.
Delivered within 10 minutes
Score Monitoring
Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.
Continuous monitoring
Scores are editorial opinions as of 2026-03-07.