MockForge 2.3.3

dotnet add package MockForge --version 2.3.3
                    
NuGet\Install-Package MockForge -Version 2.3.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MockForge" Version="2.3.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MockForge" Version="2.3.3" />
                    
Directory.Packages.props
<PackageReference Include="MockForge" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MockForge --version 2.3.3
                    
#r "nuget: MockForge, 2.3.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MockForge@2.3.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MockForge&version=2.3.3
                    
Install as a Cake Addin
#tool nuget:?package=MockForge&version=2.3.3
                    
Install as a Cake Tool

MockForge

A lightweight .NET8 library to generate fake data (mock) with zero configuration.

Providers

  • AnswerProvider

    • Magic8Ball()
    • YesNo()
    • TrueFalse()
  • IdentityProvider

    • Gender()
    • WeightedGender()
    • Species()
    • GetRobotName(string input, int number, bool keepSeparator)
    • MaleFirstName(), FemaleFirstName(), LastName()
    • MaleTitle(), FemaleTitle()
    • MaleNobleTitle(), FemaleNobleTitle()
    • City()
    • Person(...) and helpers:
      • MalePerson(...)
      • FemalePerson(...)
      • AndroidPerson(...)
      • ExtraterrestrialPerson(...)
      • OtherGenderPerson(...)
  • ColorProvider

    • GetHexColor(string input)
    • GetRgbColor(string input)
    • GetRgbaColor(string input, double alpha = 1.0)
    • GetColorName()
  • DateProvider

    • FutureDateTime(int maxYearsInFuture = 10)
    • PastDateTime(int maxYearsInPast = 50)
    • FutureDate(int maxYearsInFuture = 10)
    • PastDate(int maxYearsInPast = 50)
    • RandomTime()
    • RandomDateTime(int maxYearsPast = 50, int maxYearsFuture = 10)
    • RandomDate(int maxYearsPast = 50, int maxYearsFuture = 10)
    • RandomDateTimeByAgeRange(int minAge = 18, int? maxAge = 120)
    • RandomDateByAgeRange(int minAge = 18, int? maxAge = 120)
  • NumberProvider

    • RandomDecimal(decimal? min = 0, decimal? max = 1, int? decimals = 2)
    • RandomNumber<T>(T? min = default, T? max = default) where T : struct, IComparable<T>, IConvertible
    • RandomPaddedNumber(int length, int maxInclusive)
  • CardProvider

    • PokerCardRank(), PokerCardSuit(), PokerCard()
    • SpanishCardRank(), SpanishCardSuit(), SpanishCard()
    • UnoColor(), UnoNumberCard(), UnoActionCard(), UnoWildCard(), UnoCard()
    • TarotMajorArcana(), TarotArcanoMayor()
  • ProfessionProvider

    • Company(), CompanyDepartment()
    • StateEmployeeDepartment(), StateEmployeeRank()
    • PoliceDepartment(), PoliceRank()
    • Profession() � returns a Profession model
    • PoliceEmployee(), PublicStateEmployee()
  • FoodProvider

    • Any(), Fruit(), Vegetable(), Grain(), Protein(), Dairy(), Legume(), NutOrSeed()
  • AnimalProvider

    • Any(), Real(), Mythical()
  • PlantProvider

    • Any(), Flower(), HousePlant(), Tree(), Herb(), Shrub()
  • HousingProvider

    • Generate(int minFloor, int maxFloor) � returns ApartmentDefinition
  • ImageProvider

    • GenerateRandomBitmap(int width, int height, int tileSize = 32)
    • GeneratePngRGBNative(int width, int height, int tileSize = 32, int delta = 30)
    • GeneratePngHSVNative(int width, int height, int tileSize = 32, float maxHueStep = 15f)
    • GenerateAvatarPng(string seed, int logicalSize = 8, int scale = 8)
  • ProgressionProvider

    • Fibonacci(int n), Jacobsthal(int n), Lucas(int n), Pell(int n), HofstadterQ(int n), Exotic(int n)
    • LogisticMap(int n, double r = 4.0, double x0 = 0.2)
    • Random variants:
      • RandomFibonacci(...)
      • RandomJacobsthal(...)
      • RandomLucas(...)
      • RandomPell(...)
      • RandomHofstadterQ(...)
      • RandomLogisticMap(...)
      • RandomExotic(...)
      • RandomProgression(...)
    • GetProgressionName(int progressionType)
    • ClearCache(), ClearCache(string progressionName)
  • EnumProvider

    • GetRandomValue<T>() where T : struct, Enum
    • IsValid<T>(string? value) where T : struct, Enum
  • ArrayProvider

    • Pick<T>(T[]? array)

Quick start

Example without DI

using System;
using MockForge;
using MockForge.Providers;

var forge = MockForgeFactory.Create();
var answer = forge.Get<AnswerProvider>().Magic8Ball();
Console.WriteLine($"Magic8 Ball: {answer}");

Example with DI

using System;
using Microsoft.Extensions.DependencyInjection;
using MockForge;
using MockForge.Providers;

var services = new ServiceCollection();
// Register the provider using the factory. Alternatively, register the full "forge" instance.
services.AddSingleton(sp => MockForgeFactory.Create().Get<AnswerProvider>());

var provider = services.BuildServiceProvider().GetRequiredService<AnswerProvider>();
Console.WriteLine(provider.Magic8Ball());
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.3.3 206 11/26/2025
2.3.2 166 11/15/2025
2.3.1 194 11/14/2025
2.3.0 223 10/30/2025
2.2.0 177 10/14/2025
2.1.0 303 10/13/2025
2.0.0 206 9/28/2025
1.0.0 201 9/21/2025

Initial release of MockForge (v1.0.0): locale-aware fake data, deterministic seed support, and DI-friendly providers.