PANiXiDA.DataGenerator
1.0.0
dotnet add package PANiXiDA.DataGenerator --version 1.0.0
NuGet\Install-Package PANiXiDA.DataGenerator -Version 1.0.0
<PackageReference Include="PANiXiDA.DataGenerator" Version="1.0.0" />
<PackageVersion Include="PANiXiDA.DataGenerator" Version="1.0.0" />
<PackageReference Include="PANiXiDA.DataGenerator" />
paket add PANiXiDA.DataGenerator --version 1.0.0
#r "nuget: PANiXiDA.DataGenerator, 1.0.0"
#:package PANiXiDA.DataGenerator@1.0.0
#addin nuget:?package=PANiXiDA.DataGenerator&version=1.0.0
#tool nuget:?package=PANiXiDA.DataGenerator&version=1.0.0
PANiXiDA.DataGenerator
PANiXiDA.DataGenerator is a library for generating realistic test and sample data based on Bogus and AutoFixture.
It can automatically populate models (including nested objects and collections), control how data is mutated, and produce consistent results using scoped deterministic seeds.
The library can be used in:
- integration tests
- load testing
- prototyping
- demos and mock environments
- any scenario requiring meaningful sample data
Installation
dotnet add package PANiXiDA.DataGenerator
Quick Start
var data = new DataFacade(locale: "en", seed: 123);
var user = data.Create<User>(); // fully generated model
var modifiedUser = data.Mutate(user); // original object with several values changed
Features
• Automatic model population with realistic values
The generator provides meaningful data for common model fields (e.g. Emails, Names, Dates, Addresses).
• Full support for nested models and collections
List<T>, T[], Dictionary<TKey, TValue>, inner class models — are all populated recursively.
• Nullable fields are handled naturally
Nullable properties (string?, int?, DateTime?, etc.) are left null with a small probability.
• Deterministic output
Providing the same seed (optionally combined with scope) produces the same result across runs.
Supported Types and Property Rules
Strings (string)
| Field Name Contains | Example Output |
|---|---|
email |
realistic e-mail address |
phone, mobile |
phone number |
fullname, name, fio |
full personal name |
firstname |
given name |
lastname, surname |
family name |
username, login |
username |
password, pwd |
password containing digits |
url, link |
website URL |
avatar |
avatar image URL |
country |
country name |
city |
city |
street |
address / street |
postcode, postal, zip |
postal code |
title, subject |
short text |
desc, message, text, content |
sentence or paragraph |
company |
company name |
iban, account |
payment account number |
currency |
currency code |
| otherwise | alphanumeric string |
Numbers (int, long, decimal, float, double, etc.)
| Field Name Contains | Rule |
|---|---|
id or ends with id |
generates small or zero-like identity value |
age |
age in realistic range (18–70) |
count, qty, ends with num |
quantity-like numeric value |
price, amount, sum |
monetary values |
year |
realistic year value |
| otherwise | bounded random number |
Boolean (bool)
- Fields like
IsActive,IsEnabled,HasAccess→ mostlytrue - Fields like
IsDeleted,IsBlocked,IsDisabled→ mostlyfalse
Date and Time
| Type | Rule |
|---|---|
CreatedAt |
past date |
UpdatedAt, ModifiedAt |
recent date |
DeletedAt |
recent date or null |
BirthDate, Birthday |
realistic birthday |
Registered, Signup |
past date |
DateOnly, TimeOnly, TimeSpan |
generated accordingly |
Collections
| Type | Behavior |
|---|---|
T[] |
array of generated elements (size 2–6) |
List<T>, IList<T>, IEnumerable<T> |
list of generated elements (size 2–6) |
Dictionary<TKey, TValue> |
unique keys, generated values |
Other types
| Type | Behavior |
|---|---|
Guid |
random GUID |
char |
letter / digit / printable symbol |
enum |
random non-default value |
Uri |
valid generated URI |
Mutation
var mutated = data.Mutate(user, minChanges: 1, maxChanges: 3);
Mutation will:
- clone the object
- randomly change several writable properties
- preserve nullable behavior
- work recursively for nested objects
Fields excluded from mutation (never changed)
By default, the following fields are never mutated:
Id
CreatedAt
UpdatedAt
DeletedAt
Fields always mutated
The following fields are always mutated, even if no others change:
Login
Password
You can also explicitly exclude properties:
var mutated = data.Mutate(user, excludeProperties: new[] { nameof(User.Email) });
Deterministic Output and Scopes
var a = new DataFacade(seed: 42);
var b = new DataFacade(seed: 42);
a.Create<User>().Should().BeEquivalentTo(b.Create<User>()); // true
Scopes allow independent data streams:
var authData = new DataFacade(scope: "auth");
var orderData = new DataFacade(scope: "orders");
License
Apache 2.0 — free for commercial and open use.
Summary
| Feature | Supported |
|---|---|
| Realistic data generation | ✅ |
| Nested object population | ✅ |
| Collections & dictionaries | ✅ |
| Nullable handling | ✅ |
| Deterministic output via seed & scope | ✅ |
| Mutation with field rules | ✅ |
| Usable outside tests | ✅ |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- AutoFixture (>= 4.18.1)
- Bogus (>= 35.6.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 254 | 11/7/2025 |