From 867c76b0116c90f81a6120027511d8d842ece6f8 Mon Sep 17 00:00:00 2001 From: Andrei Ignat Date: Sun, 20 Sep 2026 17:42:15 +0300 Subject: [PATCH 1/3] forged --- README.md | 30 +- later.md | 2 +- v2/.tours/Forged.tour | 36 ++ v2/Generator/all.csv | 1 + v2/RSCGExamplesData/GeneratorDataRec.json | 6 + v2/rscg_examples/Forged/description.json | 22 + v2/rscg_examples/Forged/readme.txt | 210 ++++++++ v2/rscg_examples/Forged/src/Mock/IMyClock.cs | 8 + .../Forged/src/Mock/MockData.csproj | 9 + v2/rscg_examples/Forged/src/MockRock.slnx | 4 + .../Forged/src/TestClock/TestClock.cs | 37 ++ .../Forged/src/TestClock/TestClock.csproj | 32 ++ .../Forged/src/TestClock/Usings.cs | 2 + v2/rscg_examples/Forged/video.json | 39 ++ v2/rscg_examples_site/docs/Authors/Angius.md | 7 + .../docs/Categories/Tests.md | 24 +- .../docs/Categories/_PrimitiveTests.mdx | 22 +- .../docs/RSCG-Examples/Forged.md | 455 ++++++++++++++++++ .../docs/RSCG-Examples/index.md | 13 +- v2/rscg_examples_site/docs/about.md | 2 +- v2/rscg_examples_site/docs/indexRSCG.md | 5 +- .../src/components/HomepageFeatures/index.js | 2 +- .../static/exports/RSCG.json | 8 + .../static/exports/RSCG.xlsx | Bin 15285 -> 15320 bytes 24 files changed, 943 insertions(+), 33 deletions(-) create mode 100644 v2/.tours/Forged.tour create mode 100644 v2/rscg_examples/Forged/description.json create mode 100644 v2/rscg_examples/Forged/readme.txt create mode 100644 v2/rscg_examples/Forged/src/Mock/IMyClock.cs create mode 100644 v2/rscg_examples/Forged/src/Mock/MockData.csproj create mode 100644 v2/rscg_examples/Forged/src/MockRock.slnx create mode 100644 v2/rscg_examples/Forged/src/TestClock/TestClock.cs create mode 100644 v2/rscg_examples/Forged/src/TestClock/TestClock.csproj create mode 100644 v2/rscg_examples/Forged/src/TestClock/Usings.cs create mode 100644 v2/rscg_examples/Forged/video.json create mode 100644 v2/rscg_examples_site/docs/Authors/Angius.md create mode 100644 v2/rscg_examples_site/docs/RSCG-Examples/Forged.md diff --git a/README.md b/README.md index 7b7af4c0d..5d784abd6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# RSCG - 294 Examples of Roslyn Source Code Generators / 16 created by Microsoft / +# RSCG - 295 Examples of Roslyn Source Code Generators / 16 created by Microsoft / -The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 294 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports. +The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 295 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports. This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem -## Latest Update : 2026-09-11 => 11 September 2026 +## Latest Update : 2026-09-12 => 12 September 2026 If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)*** @@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt ## Content -Those are the 294 Roslyn Source Code Generators that I have tested you can see and download source code example. +Those are the 295 Roslyn Source Code Generators that I have tested you can see and download source code example. ( including 16 from Microsoft ) +### 295. [Forged](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged) , in the [Tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) category + +Generated on : 2026-09-12 => 12 September 2026 + +
+ Expand + + + +Author: Angius + + + +Nuget: [https://www.nuget.org/packages/Forged/](https://www.nuget.org/packages/Forged/) + + +Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged) + +Source: [https://github.com/Atulin/Forged](https://github.com/Atulin/Forged) + +
+ ### 294. [Slang.Net](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Slang.Net) , in the [FilesToCode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) category Generated on : 2026-09-11 => 11 September 2026 diff --git a/later.md b/later.md index 3ab19689e..ee85b2b76 100644 --- a/later.md +++ b/later.md @@ -1,6 +1,6 @@ # Just later -## Latest Update : 2026-09-11 => 11 September 2026 +## Latest Update : 2026-09-12 => 12 September 2026 diff --git a/v2/.tours/Forged.tour b/v2/.tours/Forged.tour new file mode 100644 index 000000000..6d82d4101 --- /dev/null +++ b/v2/.tours/Forged.tour @@ -0,0 +1,36 @@ + +{ + "$schema": "https://aka.ms/codetour-schema", + "title": "Forged", + "steps": + [ + { + "file": "rscg_examples/Forged/src/TestClock/TestClock.csproj", + "description": "First, we add Nuget [Forged](https://www.nuget.org/packages/Forged/) in csproj ", + "pattern": "Forged" + } + + ,{ + "file": "rscg_examples/Forged/src/TestClock/TestClock.cs", + "description": "File TestClock.cs ", + "pattern": "this is the code" + } + + ,{ + "file": "rscg_examples/Forged/src/Mock/IMyClock.cs", + "description": "File IMyClock.cs ", + "pattern": "this is the code" + } + + + ,{ + "file": "rscg_examples/Forged/src/TestClock/obj/GX/Forged.Generator/Forged.Generator.ForgedGenerator/QuickStartRepoStub.g.cs", + "description": "Generated File 1 from 1 : QuickStartRepoStub.g.cs ", + "line": 1 + } + + ], + + "ref": "main" + +} \ No newline at end of file diff --git a/v2/Generator/all.csv b/v2/Generator/all.csv index 1a645711b..a53249c0b 100644 --- a/v2/Generator/all.csv +++ b/v2/Generator/all.csv @@ -293,3 +293,4 @@ Nr,Key,Source,Category 292,LayeredCraft.OptimizedEnums, https://github.com/layeredcraft/optimized-enums,Enum 293,MapItEasy, https://github.com/phongnguyend/MapItEasy/,Mapper 294,Slang.Net, https://github.com/egorozh/Slang.NET/,FilesToCode +295,Forged, https://github.com/Atulin/Forged,Tests diff --git a/v2/RSCGExamplesData/GeneratorDataRec.json b/v2/RSCGExamplesData/GeneratorDataRec.json index cdc2b4b5d..6ab9103fe 100644 --- a/v2/RSCGExamplesData/GeneratorDataRec.json +++ b/v2/RSCGExamplesData/GeneratorDataRec.json @@ -1781,5 +1781,11 @@ "Category": 8, "dtStart": "2026-09-11T00:00:00", "show": true + }, + { + "ID": "Forged", + "Category": 13, + "dtStart": "2026-09-12T00:00:00", + "show": true } ] \ No newline at end of file diff --git a/v2/rscg_examples/Forged/description.json b/v2/rscg_examples/Forged/description.json new file mode 100644 index 000000000..8e5e551f3 --- /dev/null +++ b/v2/rscg_examples/Forged/description.json @@ -0,0 +1,22 @@ +{ + "generator":{ + "name":"Forged", + "nuget":[ + "https://www.nuget.org/packages/Forged/" + ], + "link":"https://github.com/Atulin/Forged", + "author":"Angius", + "source":"https://github.com/Atulin/Forged" + }, + "data":{ + "goodFor":["Generating faker data from class"], + "csprojDemo":"TestClock.csproj", + "csFiles":["IMyClock.cs","TestClock.cs"], + "excludeDirectoryGenerated":[""], + "includeAdditionalFiles":[""] + }, + "links":{ + "blog":"", + "video":"" + } +} \ No newline at end of file diff --git a/v2/rscg_examples/Forged/readme.txt b/v2/rscg_examples/Forged/readme.txt new file mode 100644 index 000000000..ff6cce56b --- /dev/null +++ b/v2/rscg_examples/Forged/readme.txt @@ -0,0 +1,210 @@ +# Forged + +[![NuGet](https://img.shields.io/nuget/v/Atulin.Forged.svg)](https://www.nuget.org/packages/Atulin.Forged) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) +[![.NET 10](https://img.shields.io/badge/.NET-10.0-purple.svg)](https://dotnet.microsoft.com/) + +A fast, strict, and strongly-typed data generator (faker) for C# powered by Source Generators. + +Forged allows you to declaratively define how your models should be faked, leveraging the C# compiler to enforce required properties, nullability, and type-safety. + +## Features + +- ๐Ÿš€ **Source Generated**: No reflection, fast at runtime, and fully trim/AOT compatible. +- ๐Ÿ›ก๏ธ **Strict & Type-Safe**: Respects your class properties. If a property in your model is `required`, the faker will force you to provide a generator for it at compile time. +- ๐ŸŒŠ **Fluent API**: A clean and readable fluent API for configuring generators and their modifiers. +- ๐ŸŽฒ **Deterministic**: Pass a seeded `Random` instance to the faker to generate the exact same data every time. + +## Quick Start + +1. Add the package to your project. +2. Decorate your model with `[Fake]`: + +```csharp +[Fake] +public class Person +{ + public required Guid Id { get; set; } + public required string FirstName { get; set; } + public required string LastName { get; set; } + public List? MiddleNames { get; set; } + public bool IsActive { get; set; } + public DateTime? DateOfBirth { get; set; } +} +``` + +or create a partial class with `[Faker]` attribute: + +```csharp +[Faker] +public partial class PersonFaker; +``` + +3. The source generator will automatically create a `{ModelName}Faker` class for you. Configure it and generate data! + +```csharp +using Forged.Core.Generators; +using Forged.Core.Generators.Text; + +// The faker properties match your model's properties! +var faker = new PersonFaker +{ + Id = f => f.Text.Guid(GuidGenerator.Kind.V7), + FirstName = f => f.Text.Alphanumeric(10), + LastName = f => f.Text.Alphanumeric(10), + + // Non-required properties can be omitted, but you can still provide a generator: + MiddleNames = f => f.Text + .Alphanumeric(5) + .Collection(3) + .Refine(c => c.ToList()) // Map to List + .OrDefault(0.5f), // 50% chance of being default (null) + + DateOfBirth = f => f.Temporal.Past().OrNull(0.2f), // 20% chance to be null + IsActive = f => f.Random.Pick(true, false) +}; + +// Generate a single item +var person = faker.Get(); + +// Generate multiple items +var people = faker.Get(5); +``` + +> [!INFO] +> When using the `Faker` attribute, the generated faker will have the same name, +> not `{ModelName}Faker`. + +### Deterministic Generation + +If you need reproducible results (e.g. in unit tests), you can provide a seeded `Random` instance to the faker: + +```csharp +var faker = new PersonFaker(new Random(12345)) +{ + // ... +}; +``` + +### Localization + +You can optionally provide a `CultureInfo` instance to the faker, which will be utilized by modifiers that support localization: + +```csharp +var faker = new PersonFaker(locale: new CultureInfo("fr-FR")) +{ + // ... +}; +``` + +### Referencing Other Properties + +If you need to reference an already-generated value, you can use `.Memo()` and `.Func()` methods: + +```csharp +// Unfortunate workaround, as `out var` does not work in object initializers. +MemoValueGenerator first = null!; +MemoValueGenerator last = null!; + +var faker = new PersonFaker +{ + FirstName = f => f.Text.Pronounceable(5, 10).Memo(out first), + LastName = f => f.Text.Pronounceable(5, 10).Memo(out last), + MiddleNames = f => f.Basic.Func(() => $"{first} {last}"), +} +``` + +## Available Generators + +The `Forge` instance (`f` in the lambda expressions) provides access to built-in generators categorized by modules: + +### `Basic` +- `.Literal(T value)` - Creates a generator that always returns the specified literal value. +- `.Func(Func func)` - Creates a generator that invokes the specified function. + +### `Random` +- `Pick(params T[] items)` - Pick a single random item from the given collection. +- `Pick(T[] items, int count)` - Pick an exact number of random items from the collection. +- `Pick(T[] items, int minCount, int maxCount)` - Pick a variable number of random items from the collection. +- `Number(T? min, T? max)` - Generate a random numeric value within the specified range (supports all numeric types). +- `WeightedPick(T[] items, float[] weights)` - Pick an item from the collection using specified weights for probability distribution. +- `WeightedPick((T item, float weight)[] items)` - Pick an item from an array of item-weight tuples. +- `Dice(string expression, RoundingMode mode)` - Roll dice using a dice expression (e.g. `2d6+4`). + +### `Temporal` +- `Between(DateTime? min, DateTime? max)` - Generate a random `DateTime` within the specified range. +- `Past(DateTime? earliest)` - Generate a random `DateTime` in the past, with an optional earliest bound. +- `Future(DateTime? latest)` - Generate a random `DateTime` in the future, with an optional latest bound. +- `DateBetween(DateOnly? min, DateOnly? max)` - Generate a random `DateOnly` within the specified range. +- `DateInPast(DateOnly? earliest)` - Generate a random `DateOnly` in the past, with an optional earliest bound. +- `DateInFuture(DateOnly? latest)` - Generate a random `DateOnly` in the future, with an optional latest bound. +- `TimeBetween(TimeOnly? min, TimeOnly? max)` - Generate a random `TimeOnly` within the specified range. + +### `Text` +- `Alphanumeric(int length)` - Generate a random alphanumeric string of fixed length. +- `Alphanumeric(int minLength, int maxLength)` - Generate a random alphanumeric string of variable length. +- `Alpha(int length)` - Generate a random alphabetic string of fixed length. +- `Alpha(int minLength, int maxLength)` - Generate a random alphabetic string of variable length. +- `Pronounceable(int length)` - Generate a random pronounceable string (syllable-based) of fixed length. +- `Pronounceable(int minLength, int maxLength)` - Generate a random pronounceable string of variable length. +- `Lorem(int length, LoremIpsumGenerator.Options? options = null)` - Generate Lorem Ipsum text with a fixed number of words. +- `Lorem(int minLength, int maxLength, LoremIpsumGenerator.Options? options = null)` - Generate Lorem Ipsum text with a variable number of words. +- `Hex(int length)` - Generate a random hexadecimal string of fixed length. +- `Hex(int minLength, int maxLength)` - Generate a random hexadecimal string of variable length. +- `Guid(GuidGenerator.Kind kind)` - Generate a GUID of the specified kind (supports V4 and V7). +- `Template(string template)` - Generate a string from a template with random placeholder replacements. + +### `Internet` +- `Username(float prefixChance, float suffixChance, float leetChance)` - Generates a random username with configurable probability for including prefixes, suffixes, and leet-speak character substitutions. +- `Domain(float ccSldChance = 0.0f)` - Generates a random domain name. +- `Email(EmailKind kind = EmailKind.Random, IGenerator? provider = null)` - Generates a random email address. + +## Modifiers & Extensions + +Any `Generator` can be customized and composed using fluent methods. These methods can be chained to create complex generation pipelines. + +### Core Modifiers (on `Generator`) +- `.Or(T other, float probability)` - Returns an alternative value with the specified probability (e.g., 0.2f = 20% chance). +- `.OrDefault(float probability)` - Returns the default value for type T with the specified probability. +- `.Refine(Func refiner)` - Transforms the generated value using the provided function. +- `.Enumerable(int length)` - Generates an `IEnumerable` with a fixed number of items. +- `.Enumerable(int minLength, int maxLength)` - Generates an `IEnumerable` with a variable number of items. +- `.Array(int length)` - Generates a `T[]` array with a fixed number of items. +- `.Array(int minLength, int maxLength)` - Generates a `T[]` array with a variable number of items. +- `.List(int length)` - Generates a `List` with a fixed number of items. +- `.List(int minLength, int maxLength)` - Generates a `List` with a variable number of items. +- `.HashSet(int length)` - Generates a `HashSet` with a fixed number of unique items. +- `.HashSet(int minLength, int maxLength)` - Generates a `HashSet` with a variable number of unique items. +- `.Cast()` - Casts the generated value to the specified type. + +### Nullable & Struct Extensions +- `.OrNull(float probability)` - For struct generators, returns null with the specified probability. +- `.Nullable()` - Converts a struct generator to a nullable struct generator. + +### Collection Conversion Extensions +- `.AsList()` - Converts an `IEnumerable` or `ICollection` generator to a `List` generator. +- `.AsHashSet()` - Converts an `IEnumerable` or `ICollection` generator to a `HashSet` generator. +- `.AsDictionary(keySelector, valueSelector)` - Converts an `IEnumerable` generator to a `Dictionary` using the provided selectors. + +### String-Specific Extensions +- `.ToUpper()` - Converts generated strings to uppercase. +- `.ToLower()` - Converts generated strings to lowercase. +- `.Range(int start, int? end = null)` - Produces substrings within the specified range. +- `.Replace(string oldValue, string newValue)` - Replaces all occurrences of a specified string with another string. +- `.Replace(char oldValue, char newValue)` - Replaces all occurrences of a specified char with another char. +- `.Replace(Regex regex, string newValue)` - Replaces substrings matching a regular expression with another string. +- `.ToTitleCase(CultureInfo? cultureInfo)` - Converts generated strings to title case using the specified culture. +- `.Capitalize(CultureInfo? cultureInfo)` - Capitalizes the first character of generated strings. +- `.Sentencify(int sentenceLength, CultureInfo? cultureInfo)` - Formats strings as proper sentences with a fixed word count. +- `.Sentencify(int minSentenceLength, int maxSentenceLength, CultureInfo? cultureInfo)` - Formats strings as proper sentences with a variable word count. + +### Temporal-Specific Extensions (DateTime) +- `.ToUtc()` - Converts generated DateTime values to UTC. +- `.ToLocal()` - Converts generated DateTime values to local time. +- `.ToDateOnly()` - Extracts the date component from DateTime values, producing DateOnly. +- `.ToTimeOnly()` - Extracts the time component from DateTime values, producing TimeOnly. +- `.TruncateToDate()` - Truncates DateTime values to date precision (sets time to midnight). + +### Formatting Extensions +- `.ToString()` - Converts generated values to their string representation. +- `.ToString(string format, CultureInfo? cultureInfo)` - Converts generated values to formatted strings using the specified format and culture (for types implementing `ISpanFormattable`). diff --git a/v2/rscg_examples/Forged/src/Mock/IMyClock.cs b/v2/rscg_examples/Forged/src/Mock/IMyClock.cs new file mode 100644 index 000000000..f712c0695 --- /dev/null +++ b/v2/rscg_examples/Forged/src/Mock/IMyClock.cs @@ -0,0 +1,8 @@ +๏ปฟnamespace MockData; + +public class IMyClock +{ + public DateTime MyNow { get; set; } = DateTime.Now; + //public DateTime GetNow()=>DateTime.Now; + public DateTime GetUtcNow()=>DateTime.UtcNow; +} \ No newline at end of file diff --git a/v2/rscg_examples/Forged/src/Mock/MockData.csproj b/v2/rscg_examples/Forged/src/Mock/MockData.csproj new file mode 100644 index 000000000..9ed914b5b --- /dev/null +++ b/v2/rscg_examples/Forged/src/Mock/MockData.csproj @@ -0,0 +1,9 @@ + + + + net10.0 + enable + enable + + + diff --git a/v2/rscg_examples/Forged/src/MockRock.slnx b/v2/rscg_examples/Forged/src/MockRock.slnx new file mode 100644 index 000000000..e2f5c864b --- /dev/null +++ b/v2/rscg_examples/Forged/src/MockRock.slnx @@ -0,0 +1,4 @@ + + + + diff --git a/v2/rscg_examples/Forged/src/TestClock/TestClock.cs b/v2/rscg_examples/Forged/src/TestClock/TestClock.cs new file mode 100644 index 000000000..67d7bd45f --- /dev/null +++ b/v2/rscg_examples/Forged/src/TestClock/TestClock.cs @@ -0,0 +1,37 @@ + + +using Forged.Core; + +namespace MockData +{ + [Faker] + public partial class QuickStartRepoStub { } +} + +namespace TestClock +{ + + + [TestClass] + public class TestClock + { + [TestMethod] + public void TestMyClock() + { + + var expectations = new QuickStartRepoStub() + { + + MyNow = f => f.Temporal.Past(DateTime.Now.AddYears(-1)) + }; + //expectations.MyNow =()=>(DateTime.Now.AddYears(-1)); + + IMyClock mock = expectations.Get(); + var data= mock.MyNow; + Assert.AreEqual(DateTime.Now.Year -1, data.Year); + + } + } + +} + diff --git a/v2/rscg_examples/Forged/src/TestClock/TestClock.csproj b/v2/rscg_examples/Forged/src/TestClock/TestClock.csproj new file mode 100644 index 000000000..0285cf35b --- /dev/null +++ b/v2/rscg_examples/Forged/src/TestClock/TestClock.csproj @@ -0,0 +1,32 @@ + + + + net10.0 + enable + enable + + false + true + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + true + $(BaseIntermediateOutputPath)\GX + + + diff --git a/v2/rscg_examples/Forged/src/TestClock/Usings.cs b/v2/rscg_examples/Forged/src/TestClock/Usings.cs new file mode 100644 index 000000000..f3be1f99c --- /dev/null +++ b/v2/rscg_examples/Forged/src/TestClock/Usings.cs @@ -0,0 +1,2 @@ +global using Microsoft.VisualStudio.TestTools.UnitTesting; +global using MockData; diff --git a/v2/rscg_examples/Forged/video.json b/v2/rscg_examples/Forged/video.json new file mode 100644 index 000000000..09c4c1c22 --- /dev/null +++ b/v2/rscg_examples/Forged/video.json @@ -0,0 +1,39 @@ +{ + "scriptName": "Forged", + "steps": +[ + {"typeStep":"exec","arg":"clipchamp.exe launch"}, + {"typeStep":"text","arg": "Welcome to Roslyn Examples"}, + {"typeStep":"text","arg":"If you want to see more examples , see List Of RSCG"}, + {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"}, + {"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "}, + +{"typeStep":"text","arg": "Today I will present Forged . Generating faker data from class ."}, +{"typeStep":"browser","arg":"https://www.nuget.org/packages/Forged/"}, +{"typeStep":"text","arg": "The whole example is here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged"}, +{"typeStep":"text","arg": "You can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged#download-example-net--c-"}, +{"typeStep":"text","arg":"Here is the code downloaded "}, +{"typeStep":"exec","arg":"explorer.exe /select,D:\\gth\\RSCG_Examples\\v2\\Generator.sln"}, +{"typeStep":"text","arg": "So , let's start the project with Visual Studio Code "}, +{"typeStep":"stepvscode","arg": "-n D:\\gth\\RSCG_Examples\\v2"}, + +{"typeStep":"text","arg": "To use it ,you will put the Nuget Forged into the csproj "}, + +{"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\Forged\\src\\TestClock\\TestClock.csproj"}, + +{"typeStep":"text","arg": "And now I will show you an example of using Forged"}, + +{"typeStep":"hide","arg": "now execute the tour in VSCode"}, +{"typeStep":"tour", "arg": "src/.tours/"}, +{"typeStep":"text","arg":" And I will execute the project"}, +{"typeStep":"showproj", "arg":"TestClock.csproj"}, +{"typeStep":"text","arg":" This concludes the project"}, +{"typeStep":"waitseconds","arg":"30"}, +{"typeStep":"text","arg": "Remember, you can download the code from here"}, +{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged#download-example-net--c-", +SpeakTest=" "}, +{"typeStep":"waitseconds","arg":"30"}, +] +} diff --git a/v2/rscg_examples_site/docs/Authors/Angius.md b/v2/rscg_examples_site/docs/Authors/Angius.md new file mode 100644 index 000000000..d8052f9ff --- /dev/null +++ b/v2/rscg_examples_site/docs/Authors/Angius.md @@ -0,0 +1,7 @@ +# Author : Angius + +Number RSCG: 1 + + + 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 + diff --git a/v2/rscg_examples_site/docs/Categories/Tests.md b/v2/rscg_examples_site/docs/Categories/Tests.md index b73e6b25b..a850df87c 100644 --- a/v2/rscg_examples_site/docs/Categories/Tests.md +++ b/v2/rscg_examples_site/docs/Categories/Tests.md @@ -1,24 +1,26 @@

Tests

-Number RSCG: 10 +Number RSCG: 11 - 1 [Imposter](/docs/Imposter) [![Nuget](https://img.shields.io/nuget/dt/Imposter?label=Imposter)](https://www.nuget.org/packages/Imposter/) ![GitHub Repo stars](https://img.shields.io/github/stars/themidnightgospel/Imposter?style=social) 2025-12-13 + 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 - 2 [KnockOff](/docs/KnockOff) [![Nuget](https://img.shields.io/nuget/dt/KnockOff?label=KnockOff)](https://www.nuget.org/packages/KnockOff/) ![GitHub Repo stars](https://img.shields.io/github/stars/NeatooDotNet/KnockOff?style=social) 2026-02-13 + 2 [Imposter](/docs/Imposter) [![Nuget](https://img.shields.io/nuget/dt/Imposter?label=Imposter)](https://www.nuget.org/packages/Imposter/) ![GitHub Repo stars](https://img.shields.io/github/stars/themidnightgospel/Imposter?style=social) 2025-12-13 - 3 [mocklis](/docs/mocklis) [![Nuget](https://img.shields.io/nuget/dt/mocklis?label=mocklis)](https://www.nuget.org/packages/mocklis/) ![GitHub Repo stars](https://img.shields.io/github/stars/mocklis/mocklis?style=social) 2024-01-03 + 3 [KnockOff](/docs/KnockOff) [![Nuget](https://img.shields.io/nuget/dt/KnockOff?label=KnockOff)](https://www.nuget.org/packages/KnockOff/) ![GitHub Repo stars](https://img.shields.io/github/stars/NeatooDotNet/KnockOff?style=social) 2026-02-13 - 4 [MockMe](/docs/MockMe) [![Nuget](https://img.shields.io/nuget/dt/MockMe?label=MockMe)](https://www.nuget.org/packages/MockMe/) ![GitHub Repo stars](https://img.shields.io/github/stars/connorivy/MockMe?style=social) 2025-02-10 + 4 [mocklis](/docs/mocklis) [![Nuget](https://img.shields.io/nuget/dt/mocklis?label=mocklis)](https://www.nuget.org/packages/mocklis/) ![GitHub Repo stars](https://img.shields.io/github/stars/mocklis/mocklis?style=social) 2024-01-03 - 5 [MSTest](/docs/MSTest) [![Nuget](https://img.shields.io/nuget/dt/MSTest.SourceGeneration?label=MSTest.SourceGeneration)](https://www.nuget.org/packages/MSTest.SourceGeneration/) ![GitHub Repo stars](https://img.shields.io/github/stars/microsoft/testfx?style=social) 2024-04-04 + 5 [MockMe](/docs/MockMe) [![Nuget](https://img.shields.io/nuget/dt/MockMe?label=MockMe)](https://www.nuget.org/packages/MockMe/) ![GitHub Repo stars](https://img.shields.io/github/stars/connorivy/MockMe?style=social) 2025-02-10 - 6 [Ridge](/docs/Ridge) [![Nuget](https://img.shields.io/nuget/dt/Ridge?label=Ridge)](https://www.nuget.org/packages/Ridge/) ![GitHub Repo stars](https://img.shields.io/github/stars/Melchy/Ridge?style=social) 2023-08-20 + 6 [MSTest](/docs/MSTest) [![Nuget](https://img.shields.io/nuget/dt/MSTest.SourceGeneration?label=MSTest.SourceGeneration)](https://www.nuget.org/packages/MSTest.SourceGeneration/) ![GitHub Repo stars](https://img.shields.io/github/stars/microsoft/testfx?style=social) 2024-04-04 - 7 [Rocks](/docs/Rocks) [![Nuget](https://img.shields.io/nuget/dt/Rocks?label=Rocks)](https://www.nuget.org/packages/Rocks/) ![GitHub Repo stars](https://img.shields.io/github/stars/JasonBock/Rocks?style=social) 2023-04-16 + 7 [Ridge](/docs/Ridge) [![Nuget](https://img.shields.io/nuget/dt/Ridge?label=Ridge)](https://www.nuget.org/packages/Ridge/) ![GitHub Repo stars](https://img.shields.io/github/stars/Melchy/Ridge?style=social) 2023-08-20 - 8 [SatorImaging.TDoubles](/docs/SatorImaging.TDoubles) [![Nuget](https://img.shields.io/nuget/dt/SatorImaging.TDoubles?label=SatorImaging.TDoubles)](https://www.nuget.org/packages/SatorImaging.TDoubles/) ![GitHub Repo stars](https://img.shields.io/github/stars/sator-imaging/TDoubles?style=social) 2026-08-27 + 8 [Rocks](/docs/Rocks) [![Nuget](https://img.shields.io/nuget/dt/Rocks?label=Rocks)](https://www.nuget.org/packages/Rocks/) ![GitHub Repo stars](https://img.shields.io/github/stars/JasonBock/Rocks?style=social) 2023-04-16 - 9 [TinyBDD.MSTest](/docs/TinyBDD.MSTest) [![Nuget](https://img.shields.io/nuget/dt/TinyBDD.MSTest?label=TinyBDD.MSTest)](https://www.nuget.org/packages/TinyBDD.MSTest/) ![GitHub Repo stars](https://img.shields.io/github/stars/JerrettDavis/TinyBDD?style=social) 2026-07-03 + 9 [SatorImaging.TDoubles](/docs/SatorImaging.TDoubles) [![Nuget](https://img.shields.io/nuget/dt/SatorImaging.TDoubles?label=SatorImaging.TDoubles)](https://www.nuget.org/packages/SatorImaging.TDoubles/) ![GitHub Repo stars](https://img.shields.io/github/stars/sator-imaging/TDoubles?style=social) 2026-08-27 - 10 [TUnit](/docs/TUnit) [![Nuget](https://img.shields.io/nuget/dt/TUnit?label=TUnit)](https://www.nuget.org/packages/TUnit/) ![GitHub Repo stars](https://img.shields.io/github/stars/thomhurst/TUnit?style=social) 2025-11-08 + 10 [TinyBDD.MSTest](/docs/TinyBDD.MSTest) [![Nuget](https://img.shields.io/nuget/dt/TinyBDD.MSTest?label=TinyBDD.MSTest)](https://www.nuget.org/packages/TinyBDD.MSTest/) ![GitHub Repo stars](https://img.shields.io/github/stars/JerrettDavis/TinyBDD?style=social) 2026-07-03 + + 11 [TUnit](/docs/TUnit) [![Nuget](https://img.shields.io/nuget/dt/TUnit?label=TUnit)](https://www.nuget.org/packages/TUnit/) ![GitHub Repo stars](https://img.shields.io/github/stars/thomhurst/TUnit?style=social) 2025-11-08 \ No newline at end of file diff --git a/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx b/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx index ca7a074f9..2d30dea7c 100644 --- a/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx +++ b/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx @@ -1,24 +1,26 @@ ### Category "Tests" has the following generators: - 1 [Imposter](/docs/Imposter) [![Nuget](https://img.shields.io/nuget/dt/Imposter?label=Imposter)](https://www.nuget.org/packages/Imposter/) ![GitHub Repo stars](https://img.shields.io/github/stars/themidnightgospel/Imposter?style=social) 2025-12-13 + 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 - 2 [KnockOff](/docs/KnockOff) [![Nuget](https://img.shields.io/nuget/dt/KnockOff?label=KnockOff)](https://www.nuget.org/packages/KnockOff/) ![GitHub Repo stars](https://img.shields.io/github/stars/NeatooDotNet/KnockOff?style=social) 2026-02-13 + 2 [Imposter](/docs/Imposter) [![Nuget](https://img.shields.io/nuget/dt/Imposter?label=Imposter)](https://www.nuget.org/packages/Imposter/) ![GitHub Repo stars](https://img.shields.io/github/stars/themidnightgospel/Imposter?style=social) 2025-12-13 - 3 [mocklis](/docs/mocklis) [![Nuget](https://img.shields.io/nuget/dt/mocklis?label=mocklis)](https://www.nuget.org/packages/mocklis/) ![GitHub Repo stars](https://img.shields.io/github/stars/mocklis/mocklis?style=social) 2024-01-03 + 3 [KnockOff](/docs/KnockOff) [![Nuget](https://img.shields.io/nuget/dt/KnockOff?label=KnockOff)](https://www.nuget.org/packages/KnockOff/) ![GitHub Repo stars](https://img.shields.io/github/stars/NeatooDotNet/KnockOff?style=social) 2026-02-13 - 4 [MockMe](/docs/MockMe) [![Nuget](https://img.shields.io/nuget/dt/MockMe?label=MockMe)](https://www.nuget.org/packages/MockMe/) ![GitHub Repo stars](https://img.shields.io/github/stars/connorivy/MockMe?style=social) 2025-02-10 + 4 [mocklis](/docs/mocklis) [![Nuget](https://img.shields.io/nuget/dt/mocklis?label=mocklis)](https://www.nuget.org/packages/mocklis/) ![GitHub Repo stars](https://img.shields.io/github/stars/mocklis/mocklis?style=social) 2024-01-03 - 5 [MSTest](/docs/MSTest) [![Nuget](https://img.shields.io/nuget/dt/MSTest.SourceGeneration?label=MSTest.SourceGeneration)](https://www.nuget.org/packages/MSTest.SourceGeneration/) ![GitHub Repo stars](https://img.shields.io/github/stars/microsoft/testfx?style=social) 2024-04-04 + 5 [MockMe](/docs/MockMe) [![Nuget](https://img.shields.io/nuget/dt/MockMe?label=MockMe)](https://www.nuget.org/packages/MockMe/) ![GitHub Repo stars](https://img.shields.io/github/stars/connorivy/MockMe?style=social) 2025-02-10 - 6 [Ridge](/docs/Ridge) [![Nuget](https://img.shields.io/nuget/dt/Ridge?label=Ridge)](https://www.nuget.org/packages/Ridge/) ![GitHub Repo stars](https://img.shields.io/github/stars/Melchy/Ridge?style=social) 2023-08-20 + 6 [MSTest](/docs/MSTest) [![Nuget](https://img.shields.io/nuget/dt/MSTest.SourceGeneration?label=MSTest.SourceGeneration)](https://www.nuget.org/packages/MSTest.SourceGeneration/) ![GitHub Repo stars](https://img.shields.io/github/stars/microsoft/testfx?style=social) 2024-04-04 - 7 [Rocks](/docs/Rocks) [![Nuget](https://img.shields.io/nuget/dt/Rocks?label=Rocks)](https://www.nuget.org/packages/Rocks/) ![GitHub Repo stars](https://img.shields.io/github/stars/JasonBock/Rocks?style=social) 2023-04-16 + 7 [Ridge](/docs/Ridge) [![Nuget](https://img.shields.io/nuget/dt/Ridge?label=Ridge)](https://www.nuget.org/packages/Ridge/) ![GitHub Repo stars](https://img.shields.io/github/stars/Melchy/Ridge?style=social) 2023-08-20 - 8 [SatorImaging.TDoubles](/docs/SatorImaging.TDoubles) [![Nuget](https://img.shields.io/nuget/dt/SatorImaging.TDoubles?label=SatorImaging.TDoubles)](https://www.nuget.org/packages/SatorImaging.TDoubles/) ![GitHub Repo stars](https://img.shields.io/github/stars/sator-imaging/TDoubles?style=social) 2026-08-27 + 8 [Rocks](/docs/Rocks) [![Nuget](https://img.shields.io/nuget/dt/Rocks?label=Rocks)](https://www.nuget.org/packages/Rocks/) ![GitHub Repo stars](https://img.shields.io/github/stars/JasonBock/Rocks?style=social) 2023-04-16 - 9 [TinyBDD.MSTest](/docs/TinyBDD.MSTest) [![Nuget](https://img.shields.io/nuget/dt/TinyBDD.MSTest?label=TinyBDD.MSTest)](https://www.nuget.org/packages/TinyBDD.MSTest/) ![GitHub Repo stars](https://img.shields.io/github/stars/JerrettDavis/TinyBDD?style=social) 2026-07-03 + 9 [SatorImaging.TDoubles](/docs/SatorImaging.TDoubles) [![Nuget](https://img.shields.io/nuget/dt/SatorImaging.TDoubles?label=SatorImaging.TDoubles)](https://www.nuget.org/packages/SatorImaging.TDoubles/) ![GitHub Repo stars](https://img.shields.io/github/stars/sator-imaging/TDoubles?style=social) 2026-08-27 - 10 [TUnit](/docs/TUnit) [![Nuget](https://img.shields.io/nuget/dt/TUnit?label=TUnit)](https://www.nuget.org/packages/TUnit/) ![GitHub Repo stars](https://img.shields.io/github/stars/thomhurst/TUnit?style=social) 2025-11-08 + 10 [TinyBDD.MSTest](/docs/TinyBDD.MSTest) [![Nuget](https://img.shields.io/nuget/dt/TinyBDD.MSTest?label=TinyBDD.MSTest)](https://www.nuget.org/packages/TinyBDD.MSTest/) ![GitHub Repo stars](https://img.shields.io/github/stars/JerrettDavis/TinyBDD?style=social) 2026-07-03 + + 11 [TUnit](/docs/TUnit) [![Nuget](https://img.shields.io/nuget/dt/TUnit?label=TUnit)](https://www.nuget.org/packages/TUnit/) ![GitHub Repo stars](https://img.shields.io/github/stars/thomhurst/TUnit?style=social) 2025-11-08 ### See category diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/Forged.md b/v2/rscg_examples_site/docs/RSCG-Examples/Forged.md new file mode 100644 index 000000000..968b7a11c --- /dev/null +++ b/v2/rscg_examples_site/docs/RSCG-Examples/Forged.md @@ -0,0 +1,455 @@ +--- +sidebar_position: 2950 +title: 295 - Forged +description: Generating faker data from class +slug: /Forged +--- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; +import TOCInline from '@theme/TOCInline'; +import SameCategory from '../Categories/_PrimitiveTests.mdx'; + +# Forged by Angius + + + + +## NuGet / site data +[![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) +[![GitHub last commit](https://img.shields.io/github/last-commit/Atulin/Forged?label=updated)](https://github.com/Atulin/Forged) +![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) + +## Details + +### Info +:::info + +Name: **Forged** + + + +Author: Angius + +NuGet: +*https://www.nuget.org/packages/Forged/* + + +You can find more details at https://github.com/Atulin/Forged + +Source: https://github.com/Atulin/Forged + +::: + +### Author +:::note +Angius +![Alt text](https://github.com/Atulin.png) +::: + +## Original Readme +:::note + +### Forged + +[![NuGet](https://img.shields.io/nuget/v/Atulin.Forged.svg)](https://www.nuget.org/packages/Atulin.Forged) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/Atulin/Forged/LICENSE) +[![.NET 10](https://img.shields.io/badge/.NET-10.0-purple.svg)](https://dotnet.microsoft.com/) + +A fast, strict, and strongly-typed data generator (faker) for C# powered by Source Generators. + +Forged allows you to declaratively define how your models should be faked, leveraging the C# compiler to enforce required properties, nullability, and type-safety. + +###### Features + +- ๐Ÿš€ **Source Generated**: No reflection, fast at runtime, and fully trim/AOT compatible. +- ๐Ÿ›ก๏ธ **Strict & Type-Safe**: Respects your class properties. If a property in your model is `required`, the faker will force you to provide a generator for it at compile time. +- ๐ŸŒŠ **Fluent API**: A clean and readable fluent API for configuring generators and their modifiers. +- ๐ŸŽฒ **Deterministic**: Pass a seeded `Random` instance to the faker to generate the exact same data every time. + +###### Quick Start + +1. Add the package to your project. +2. Decorate your model with `[Fake]`: + +```csharp +[Fake] +public class Person +{ + public required Guid Id \{ get; set; } + public required string FirstName \{ get; set; } + public required string LastName \{ get; set; } + public List? MiddleNames \{ get; set; } + public bool IsActive \{ get; set; } + public DateTime? DateOfBirth \{ get; set; } +} +``` + +or create a partial class with `[Faker]` attribute: + +```csharp +[Faker] +public partial class PersonFaker; +``` + +3. The source generator will automatically create a `{ModelName}Faker` class for you. Configure it and generate data! + +```csharp +using Forged.Core.Generators; +using Forged.Core.Generators.Text; + +// The faker properties match your model's properties! +var faker = new PersonFaker +{ + Id = f => f.Text.Guid(GuidGenerator.Kind.V7), + FirstName = f => f.Text.Alphanumeric(10), + LastName = f => f.Text.Alphanumeric(10), + + // Non-required properties can be omitted, but you can still provide a generator: + MiddleNames = f => f.Text + .Alphanumeric(5) + .Collection(3) + .Refine(c => c.ToList()) // Map to List + .OrDefault(0.5f), // 50% chance of being default (null) + + DateOfBirth = f => f.Temporal.Past().OrNull(0.2f), // 20% chance to be null + IsActive = f => f.Random.Pick(true, false) +}; + +// Generate a single item +var person = faker.Get(); + +// Generate multiple items +var people = faker.Get(5); +``` + +> [!INFO] +> When using the `Faker` attribute, the generated faker will have the same name, +> not `{ModelName}Faker`. + +######### Deterministic Generation + +If you need reproducible results (e.g. in unit tests), you can provide a seeded `Random` instance to the faker: + +```csharp +var faker = new PersonFaker(new Random(12345)) +{ + // ... +}; +``` + +######### Localization + +You can optionally provide a `CultureInfo` instance to the faker, which will be utilized by modifiers that support localization: + +```csharp +var faker = new PersonFaker(locale: new CultureInfo("fr-FR")) +{ + // ... +}; +``` + +######### Referencing Other Properties + +If you need to reference an already-generated value, you can use `.Memo()` and `.Func()` methods: + +```csharp +// Unfortunate workaround, as `out var` does not work in object initializers. +MemoValueGenerator first = null!; +MemoValueGenerator last = null!; + +var faker = new PersonFaker +{ + FirstName = f => f.Text.Pronounceable(5, 10).Memo(out first), + LastName = f => f.Text.Pronounceable(5, 10).Memo(out last), + MiddleNames = f => f.Basic.Func(() => $"{first} {last}"), +} +``` + +###### Available Generators + +The `Forge` instance (`f` in the lambda expressions) provides access to built-in generators categorized by modules: + +######### `Basic` +- `.Literal(T value)` - Creates a generator that always returns the specified literal value. +- `.Func(Func func)` - Creates a generator that invokes the specified function. + +######### `Random` +- `Pick(params T[] items)` - Pick a single random item from the given collection. +- `Pick(T[] items, int count)` - Pick an exact number of random items from the collection. +- `Pick(T[] items, int minCount, int maxCount)` - Pick a variable number of random items from the collection. +- `Number(T? min, T? max)` - Generate a random numeric value within the specified range (supports all numeric types). +- `WeightedPick(T[] items, float[] weights)` - Pick an item from the collection using specified weights for probability distribution. +- `WeightedPick((T item, float weight)[] items)` - Pick an item from an array of item-weight tuples. +- `Dice(string expression, RoundingMode mode)` - Roll dice using a dice expression (e.g. `2d6+4`). + +######### `Temporal` +- `Between(DateTime? min, DateTime? max)` - Generate a random `DateTime` within the specified range. +- `Past(DateTime? earliest)` - Generate a random `DateTime` in the past, with an optional earliest bound. +- `Future(DateTime? latest)` - Generate a random `DateTime` in the future, with an optional latest bound. +- `DateBetween(DateOnly? min, DateOnly? max)` - Generate a random `DateOnly` within the specified range. +- `DateInPast(DateOnly? earliest)` - Generate a random `DateOnly` in the past, with an optional earliest bound. +- `DateInFuture(DateOnly? latest)` - Generate a random `DateOnly` in the future, with an optional latest bound. +- `TimeBetween(TimeOnly? min, TimeOnly? max)` - Generate a random `TimeOnly` within the specified range. + +######### `Text` +- `Alphanumeric(int length)` - Generate a random alphanumeric string of fixed length. +- `Alphanumeric(int minLength, int maxLength)` - Generate a random alphanumeric string of variable length. +- `Alpha(int length)` - Generate a random alphabetic string of fixed length. +- `Alpha(int minLength, int maxLength)` - Generate a random alphabetic string of variable length. +- `Pronounceable(int length)` - Generate a random pronounceable string (syllable-based) of fixed length. +- `Pronounceable(int minLength, int maxLength)` - Generate a random pronounceable string of variable length. +- `Lorem(int length, LoremIpsumGenerator.Options? options = null)` - Generate Lorem Ipsum text with a fixed number of words. +- `Lorem(int minLength, int maxLength, LoremIpsumGenerator.Options? options = null)` - Generate Lorem Ipsum text with a variable number of words. +- `Hex(int length)` - Generate a random hexadecimal string of fixed length. +- `Hex(int minLength, int maxLength)` - Generate a random hexadecimal string of variable length. +- `Guid(GuidGenerator.Kind kind)` - Generate a GUID of the specified kind (supports V4 and V7). +- `Template(string template)` - Generate a string from a template with random placeholder replacements. + +######### `Internet` +- `Username(float prefixChance, float suffixChance, float leetChance)` - Generates a random username with configurable probability for including prefixes, suffixes, and leet-speak character substitutions. +- `Domain(float ccSldChance = 0.0f)` - Generates a random domain name. +- `Email(EmailKind kind = EmailKind.Random, IGenerator? provider = null)` - Generates a random email address. + +###### Modifiers & Extensions + +Any `Generator` can be customized and composed using fluent methods. These methods can be chained to create complex generation pipelines. + +######### Core Modifiers (on `Generator`) +- `.Or(T other, float probability)` - Returns an alternative value with the specified probability (e.g., 0.2f = 20% chance). +- `.OrDefault(float probability)` - Returns the default value for type T with the specified probability. +- `.Refine(Func refiner)` - Transforms the generated value using the provided function. +- `.Enumerable(int length)` - Generates an `IEnumerable` with a fixed number of items. +- `.Enumerable(int minLength, int maxLength)` - Generates an `IEnumerable` with a variable number of items. +- `.Array(int length)` - Generates a `T[]` array with a fixed number of items. +- `.Array(int minLength, int maxLength)` - Generates a `T[]` array with a variable number of items. +- `.List(int length)` - Generates a `List` with a fixed number of items. +- `.List(int minLength, int maxLength)` - Generates a `List` with a variable number of items. +- `.HashSet(int length)` - Generates a `HashSet` with a fixed number of unique items. +- `.HashSet(int minLength, int maxLength)` - Generates a `HashSet` with a variable number of unique items. +- `.Cast()` - Casts the generated value to the specified type. + +######### Nullable & Struct Extensions +- `.OrNull(float probability)` - For struct generators, returns null with the specified probability. +- `.Nullable()` - Converts a struct generator to a nullable struct generator. + +######### Collection Conversion Extensions +- `.AsList()` - Converts an `IEnumerable` or `ICollection` generator to a `List` generator. +- `.AsHashSet()` - Converts an `IEnumerable` or `ICollection` generator to a `HashSet` generator. +- `.AsDictionary(keySelector, valueSelector)` - Converts an `IEnumerable` generator to a `Dictionary` using the provided selectors. + +######### String-Specific Extensions +- `.ToUpper()` - Converts generated strings to uppercase. +- `.ToLower()` - Converts generated strings to lowercase. +- `.Range(int start, int? end = null)` - Produces substrings within the specified range. +- `.Replace(string oldValue, string newValue)` - Replaces all occurrences of a specified string with another string. +- `.Replace(char oldValue, char newValue)` - Replaces all occurrences of a specified char with another char. +- `.Replace(Regex regex, string newValue)` - Replaces substrings matching a regular expression with another string. +- `.ToTitleCase(CultureInfo? cultureInfo)` - Converts generated strings to title case using the specified culture. +- `.Capitalize(CultureInfo? cultureInfo)` - Capitalizes the first character of generated strings. +- `.Sentencify(int sentenceLength, CultureInfo? cultureInfo)` - Formats strings as proper sentences with a fixed word count. +- `.Sentencify(int minSentenceLength, int maxSentenceLength, CultureInfo? cultureInfo)` - Formats strings as proper sentences with a variable word count. + +######### Temporal-Specific Extensions (DateTime) +- `.ToUtc()` - Converts generated DateTime values to UTC. +- `.ToLocal()` - Converts generated DateTime values to local time. +- `.ToDateOnly()` - Extracts the date component from DateTime values, producing DateOnly. +- `.ToTimeOnly()` - Extracts the time component from DateTime values, producing TimeOnly. +- `.TruncateToDate()` - Truncates DateTime values to date precision (sets time to midnight). + +######### Formatting Extensions +- `.ToString()` - Converts generated values to their string representation. +- `.ToString(string format, CultureInfo? cultureInfo)` - Converts generated values to formatted strings using the specified format and culture (for types implementing `ISpanFormattable`). + + +::: + +### About +:::note + +Generating faker data from class + + +::: + +## How to use + +### Example (source csproj, source files) + + + + + +This is the CSharp Project that references **Forged** +```xml showLineNumbers {13} + + + + net10.0 + enable + enable + + false + true + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + true + $(BaseIntermediateOutputPath)\GX + + + + +``` + + + + + + This is the use of **Forged** in *IMyClock.cs* + +```csharp showLineNumbers +namespace MockData; + +public class IMyClock +{ + public DateTime MyNow \{ get; set; \} = DateTime.Now; + //public DateTime GetNow()=>DateTime.Now; + public DateTime GetUtcNow()=>DateTime.UtcNow; +} +``` + + + + + This is the use of **Forged** in *TestClock.cs* + +```csharp showLineNumbers + + +using Forged.Core; + +namespace MockData +{ + [Faker] + public partial class QuickStartRepoStub \{ } +} + +namespace TestClock +{ + + + [TestClass] + public class TestClock + { + [TestMethod] + public void TestMyClock() + { + + var expectations = new QuickStartRepoStub() + { + + MyNow = f => f.Temporal.Past(DateTime.Now.AddYears(-1)) + }; + //expectations.MyNow =()=>(DateTime.Now.AddYears(-1)); + + IMyClock mock = expectations.Get(); + var data= mock.MyNow; + Assert.AreEqual(DateTime.Now.Year -1, data.Year); + + } + } + +} + + +``` + + + + +### Generated Files + +Those are taken from $(BaseIntermediateOutputPath)\GX + + + + +```csharp showLineNumbers +//---------------------------------------------------------------------------- +// +// This code was generated by Forged.Generator +// Runtime version: 1.0.0 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//---------------------------------------------------------------------------- +#nullable enable + +namespace MockData; + +[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute] +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] +[global::System.CodeDom.Compiler.GeneratedCode("Forged.Generator", "1.0.0.0")] +public partial class QuickStartRepoStub : global::Forged.Core.Faker +{ + public virtual global::System.Func>? MyNow \{ get; init; } + + // Constructor + public QuickStartRepoStub(global::System.Random? random = null, global::System.Globalization.CultureInfo? locale = null) : base(random, locale) \{ } + + public override IMyClock Get() + { + var myNowGenerator = MyNow?.Invoke(this.Forge); + + return new IMyClock + { + MyNow = myNowGenerator?.Generate() ?? default!, + }; + } +} + +``` + + + + +## Useful + +### Download Example (.NET C#) + +:::tip + +[Download Example project Forged ](/sources/Forged.zip) + +::: + + +### Share Forged + + + +https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged + + + diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/index.md b/v2/rscg_examples_site/docs/RSCG-Examples/index.md index a872b6755..8a3ef85d4 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/index.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/index.md @@ -1,7 +1,7 @@ --- sidebar_position: 30 -title: 294 RSCG list by category -description: 294 RSCG list by category +title: 295 RSCG list by category +description: 295 RSCG list by category slug: /rscg-examples --- @@ -1728,7 +1728,7 @@ import DocCardList from '@theme/DocCardList'; ## Tests
- Expand Tests =>examples:10 + Expand Tests =>examples:11 @@ -1779,6 +1779,11 @@ import DocCardList from '@theme/DocCardList'; [SatorImaging.TDoubles](/docs/SatorImaging.TDoubles) + + + +[Forged](/docs/Forged) +
@@ -2401,6 +2406,8 @@ flowchart LR; Tests--> SatorImaging.TDoubles((SatorImaging.TDoubles)) + Tests--> Forged((Forged)) + Validator--> validly((validly)) WinAPI--> Com((Com)) diff --git a/v2/rscg_examples_site/docs/about.md b/v2/rscg_examples_site/docs/about.md index 4139f363f..d273acbfd 100644 --- a/v2/rscg_examples_site/docs/about.md +++ b/v2/rscg_examples_site/docs/about.md @@ -6,7 +6,7 @@ title: About ## Content You will find here code examples -of 294 Roslyn Source Code Generator (RSCG) +of 295 Roslyn Source Code Generator (RSCG) that can be useful for you. That means, you will write more elegant and concise code - even if the generators code is not always nice to look. ## Are those examples ready for production? diff --git a/v2/rscg_examples_site/docs/indexRSCG.md b/v2/rscg_examples_site/docs/indexRSCG.md index 12ab7161d..128f57100 100644 --- a/v2/rscg_examples_site/docs/indexRSCG.md +++ b/v2/rscg_examples_site/docs/indexRSCG.md @@ -7,9 +7,9 @@ slug: /List-of-RSCG import useBaseUrl from '@docusaurus/useBaseUrl'; -## 294 RSCG with examples in descending chronological order +## 295 RSCG with examples in descending chronological order -This is the list of 294 ( 16 from Microsoft) RSCG with examples +This is the list of 295 ( 16 from Microsoft) RSCG with examples [See by category](/docs/rscg-examples) [See as json](/exports/RSCG.json) [See as Excel](/exports/RSCG.xlsx) @@ -20,6 +20,7 @@ This is the list of 294 ( 16 from Microsoft) RSCG with examples | No | Name | Date | Category | | --------- | ----- | ---- | -------- | +|295| [Forged by Angius ](/docs/Forged)|2026-09-12 => 12 September 2026 | [Tests](/docs/Categories/Tests) | |294| [Slang.Net by Egor Zheludkov ](/docs/Slang.Net)|2026-09-11 => 11 September 2026 | [FilesToCode](/docs/Categories/FilesToCode) | |293| [MapItEasy by Phong Nguyen ](/docs/MapItEasy)|2026-09-10 => 10 September 2026 | [Mapper](/docs/Categories/Mapper) | |292| [LayeredCraft.OptimizedEnums by LayeredCraft ](/docs/LayeredCraft.OptimizedEnums)|2026-09-06 => 06 September 2026 | [Enum](/docs/Categories/Enum) | diff --git a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js index 27d47389c..01b05745b 100644 --- a/v2/rscg_examples_site/src/components/HomepageFeatures/index.js +++ b/v2/rscg_examples_site/src/components/HomepageFeatures/index.js @@ -4,7 +4,7 @@ import styles from './styles.module.css'; const FeatureList = [ { -title: '294 Examples (16 from MSFT)', +title: '295 Examples (16 from MSFT)', Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, description: ( <> diff --git a/v2/rscg_examples_site/static/exports/RSCG.json b/v2/rscg_examples_site/static/exports/RSCG.json index 6de032e2c..19e410388 100644 --- a/v2/rscg_examples_site/static/exports/RSCG.json +++ b/v2/rscg_examples_site/static/exports/RSCG.json @@ -2353,6 +2353,14 @@ "Source": "https://github.com/egorozh/Slang.NET/", "Category": "FilesToCode", "AddedOn": "2026-09-11T00:00:00" + }, + { + "Name": "Forged", + "Link": "https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged", + "NuGet": "https://www.nuget.org/packages/Forged/", + "Source": "https://github.com/Atulin/Forged", + "Category": "Tests", + "AddedOn": "2026-09-12T00:00:00" } ] } \ No newline at end of file diff --git a/v2/rscg_examples_site/static/exports/RSCG.xlsx b/v2/rscg_examples_site/static/exports/RSCG.xlsx index 75f60685651679a366e429dd1be497fe5c6b4bd9..56f4dc8a32551a51253a870c9bde515ea65c434e 100644 GIT binary patch delta 848 zcmdm5extlTz?+#xgn@y9gTbZOB-X>5+3En0r^Lv>zz?J=a`emdi?WmQ^Rx9Ta&vn7 z@8%sc;Bkvr{q)zv_~4e%+?^6akHqF3$d#4a+PT`oL4H2Zx8mKqAD^FAx-V<@56@W5 zuEzn*k)jJUO783~Sod(!o72`gv$HhwWsXm)4Ebs2QNQzw!4i|{QQqbg+#^5wD8AQm z@7L`AxF)r)WiOA*N&jD4HSTS37k}{jzVg)gAV%A(1va(s9Bn5#&o6a2dMVW+@7BFV zhHTL$+1d6FZY%#g-n_O{_U(?{6RhWf1XviG;iD*A=CRp_iWW#mld&^ zuDWa-S<@m|<3Afd4{%#Pqb{7SRQv;jquv>PNqMGF>-}@H-u=6zS05(sGsXV@`~Unf zTN%J%9K2!DzRioxWElBVEs{*kjVvuq%}h*;%*`jCGneB8xutFjC-=?CU(MC)t@92W z@HnhjDp;SYn)gsFa8t=isV7WZd~Ukscutt1W*OZsqZz&;O2n0?}ffz$kr?inYXOA-0)yJT!baVG^Se3hB)$5uqf6Nz7?r*;${PE7q<#VRmH}AS!ofFmV zrI`~Ddd;r><;k1E*W_U#0!nq8EVUWI-UcVW$tG4NOfJ2Xv#exn-$GJgaYeGNb8gu$x(kH&N6?bOMt?#K-RDCTr_mSb(7njck6lg6o zoTKucG4!x*QpwyoX*Xl6Qf+Pi*#`fc^x;$@>+i!=+>d6ynYDyjNyO~nKa0y+=2pf( zOJ+V^)VSUK$MNQ#jZ)@I^!aLQI$7R?_{`n8)wX#;sb+l;r+w{fYgC_}if{NdkC9bJ%>2X|}Q5*-2|3WZONHSv5uE^7~T?Yh^z;t~#hMDbG}E zy?<_&-TzB^^{O=t#{^vvY-N3Zvc%$5$d3j+|26%Km)$uwjXjrd zmuuYgr`-MhJTvNzZoZTHpzo5OoB!eL?8hB_b&Q`~t}_a6nA@j2iK$L<-)5!F4Y^XR z(L3w6h8nLAJhwz(D$B9|zAxT9RxIr>DgD*C`BVBzxi8<&yK!fGX=iB`+^c!{@uYB= zJgSFp>dk-n3z*O%m>3v@fpoNUeqKpxUdd)#OF>3Xc#@nPZe_x>vuSd#l?>y{$*Zhn zR1 Zs Date: Sun, 20 Sep 2026 17:44:56 +0300 Subject: [PATCH 2/3] zip files --- v2/book/examples/Forged.html | 59 ++++++++++++++++++ v2/book/list.html | 6 +- v2/book/pandocHTML.yaml | 1 + v2/docFind.json | 6 ++ .../static/sources/Forged.zip | Bin 0 -> 2115 bytes 5 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 v2/book/examples/Forged.html create mode 100644 v2/rscg_examples_site/static/sources/Forged.zip diff --git a/v2/book/examples/Forged.html b/v2/book/examples/Forged.html new file mode 100644 index 000000000..c61cd98d5 --- /dev/null +++ b/v2/book/examples/Forged.html @@ -0,0 +1,59 @@ + +

RSCG nr 295 : Forged

+ +

Info

+Nuget : https://www.nuget.org/packages/Forged/ + +

You can find more details at : https://github.com/Atulin/Forged

+ +

Author :Angius

+ +

Source: https://github.com/Atulin/Forged

+ +

About

+ +Generating faker data from class + +

+ How to use +

+

+ Add reference to the Forged in the csproj +

+ + +

This was for me the starting code

+ +
+ I have coded the file IMyClock.cs +
+ +
+ +
+ I have coded the file TestClock.cs +
+ +
+

And here are the generated files

+ +
+ The file generated is QuickStartRepoStub.g.cs +
+ + +

+ You can download the code and this page as pdf from + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged + +

+ + +

+ You can see the whole list at + + https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG + +

+ diff --git a/v2/book/list.html b/v2/book/list.html index 7bf64ea94..55d1303c3 100644 --- a/v2/book/list.html +++ b/v2/book/list.html @@ -17,7 +17,7 @@

-This is the list of 294 RSCG with examples => +This is the list of 295 RSCG with examples =>

@@ -1202,6 +1202,10 @@

+ + + +
294 Slang.Net
295Forged
diff --git a/v2/book/pandocHTML.yaml b/v2/book/pandocHTML.yaml index cf2686cd9..6927d3a29 100644 --- a/v2/book/pandocHTML.yaml +++ b/v2/book/pandocHTML.yaml @@ -308,6 +308,7 @@ input-files: - examples/LayeredCraft.OptimizedEnums.html - examples/MapItEasy.html - examples/Slang.Net.html +- examples/Forged.html # or you may use input-file: with a single value # defaults: diff --git a/v2/docFind.json b/v2/docFind.json index e827b1b63..333821cf2 100644 --- a/v2/docFind.json +++ b/v2/docFind.json @@ -1762,5 +1762,11 @@ "category": "FilesToCode", "href": "/RSCG_Examples/v2/docs/Slang.Net/", "body": "Type-safe i18n for .NET" + }, + { + "title": "Forged", + "category": "Tests", + "href": "/RSCG_Examples/v2/docs/Forged/", + "body": "" } ] \ No newline at end of file diff --git a/v2/rscg_examples_site/static/sources/Forged.zip b/v2/rscg_examples_site/static/sources/Forged.zip new file mode 100644 index 0000000000000000000000000000000000000000..f78d669fcb4cb685a1d0299f2a74388f99cffa94 GIT binary patch literal 2115 zcmbtVdo)yg6h4gcyreLCSfRLg6f?-9SyveEF&X1{Ezd3)@@NJJHRdLf+==v%S00f@ zhC+FiBpIaf8c7~W_ex4ArJ}6VJ!9R>SWAE1bJjj%wV4NiFw7FHT zbKQaW^W0m5c44OsWELuS))Zeln6jx$>*G6;NvrzFcSmk z>4i=HzkFDN1Kl!=pL9ROXkr}o^{0kJ;Qb@Z5@>Oebwq!{B}1$-)*T-Vk^*m7M3Vd? zt|wffu^>5eW>)!yETV{H;SKZ0Z1tRa^J^J#UnZmuQ_p` zf6#Vts=!n9{6KF_ZObK^TW9s)9yE~7GBZYxh@p@xnf zk55o%TEn$bt(o=gi7(c}F?6=(3GrBQqs7S$H0~`T6NiDkacWgV%X7tY9bLFXLlv%7#Rx4~&>u)g{MwJs(!mhB&=4N-33M24W zH9LQQmcPmDPu@aETc=J}(o^t$pauA1OHFHnOOh6TTi>Wo$j8R?*<;L`xVLuCOf=d( zsPn&;%T-K8_c)i5L(*`UaXXMaL&rlh2dk9JS}g`ccjLzyr^>Huuyk^if|He|{%9Gu zkLph>h^aJQc$9S}PI-7Lb-tU?ylZ4+WE}_M#uv*Pj}(h7UPV7Htw$@hlKaL^E68nP zxG5jljx#-(STtmAa!l3>bdqA?7#1u9G+Oflsps5M;xTWJb`9Snht1A?&}~~>gdYeM z^E3I9tbe;^VX2B-<2<8sVKiNiGr7w25ne>H`%A#`4*t9o@Q3 zZX6Gq`vdBI85__y|6=|{iU*-iT*Y*6{=wWGb{d#lUI>y(>ZU-=r9j17w&@{eZ zrPgeaHe*l*?uxc#ZSHt(M|zp-HeJ)I_*{IrU=fncWW2L~Yb5guTn(twYjkHO8UWCMa=K9L-w5kzF$xgdD z@#biA_nE1QY#-lmG8!|eJn;ZdhyzsnmXI}P#iYA=rRmOX?REE_J`-P21C=1o&3Go3 zoxst&w<0hv)GD%G59J)uOD78nkTw)NPldVik zK3iFCY-pXGw{$Vz7D~I9ed$`g)Ei`HN;3(ONDlM*3YkR_K@#C3q{(r?k zVyJqBdFDZ1JsV?}(iquJv);1cSxOT6z?jFtnpYfy%ugOTF$cv=H8 z-JRMZ@8eHiqu2L2eSG;_P=iLMhG?6}kF)^beagTG&b0E_!rscnFV8+mfuh5rAgmQ7 zJd8%)7aT Date: Sun, 20 Sep 2026 20:01:23 +0300 Subject: [PATCH 3/3] correct data --- README.md | 4 ++-- v2/.tours/Forged.tour | 4 ++-- v2/RSCGExamplesData/GeneratorDataRec.json | 1 + v2/rscg_examples/Forged/description.json | 2 +- v2/rscg_examples/Forged/nuget.txt | 1 + v2/rscg_examples/Forged/video.json | 8 ++++---- v2/rscg_examples_site/docs/Authors/Angius.md | 2 +- v2/rscg_examples_site/docs/Categories/Tests.md | 2 +- v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx | 2 +- v2/rscg_examples_site/docs/RSCG-Examples/Forged.md | 6 +++--- v2/rscg_examples_site/static/exports/RSCG.json | 2 +- 11 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 v2/rscg_examples/Forged/nuget.txt diff --git a/README.md b/README.md index 5d784abd6..8a4b23f79 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,9 @@ Generated on : 2026-09-12 => 12 September 2026 Author: Angius - +A fast, strict, and strongly-typed data generator (faker) for C# powered by Source Generators. -Nuget: [https://www.nuget.org/packages/Forged/](https://www.nuget.org/packages/Forged/) +Nuget: [https://www.nuget.org/packages/Atulin.Forged/](https://www.nuget.org/packages/Atulin.Forged/) Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged) diff --git a/v2/.tours/Forged.tour b/v2/.tours/Forged.tour index 6d82d4101..7f881a33b 100644 --- a/v2/.tours/Forged.tour +++ b/v2/.tours/Forged.tour @@ -6,8 +6,8 @@ [ { "file": "rscg_examples/Forged/src/TestClock/TestClock.csproj", - "description": "First, we add Nuget [Forged](https://www.nuget.org/packages/Forged/) in csproj ", - "pattern": "Forged" + "description": "First, we add Nuget [Atulin.Forged](https://www.nuget.org/packages/Atulin.Forged/) in csproj ", + "pattern": "Atulin.Forged" } ,{ diff --git a/v2/RSCGExamplesData/GeneratorDataRec.json b/v2/RSCGExamplesData/GeneratorDataRec.json index 6ab9103fe..8ebe7c4d2 100644 --- a/v2/RSCGExamplesData/GeneratorDataRec.json +++ b/v2/RSCGExamplesData/GeneratorDataRec.json @@ -1788,4 +1788,5 @@ "dtStart": "2026-09-12T00:00:00", "show": true } + ] \ No newline at end of file diff --git a/v2/rscg_examples/Forged/description.json b/v2/rscg_examples/Forged/description.json index 8e5e551f3..2f6b3d294 100644 --- a/v2/rscg_examples/Forged/description.json +++ b/v2/rscg_examples/Forged/description.json @@ -2,7 +2,7 @@ "generator":{ "name":"Forged", "nuget":[ - "https://www.nuget.org/packages/Forged/" + "https://www.nuget.org/packages/Atulin.Forged/" ], "link":"https://github.com/Atulin/Forged", "author":"Angius", diff --git a/v2/rscg_examples/Forged/nuget.txt b/v2/rscg_examples/Forged/nuget.txt new file mode 100644 index 000000000..5bfaf3fcc --- /dev/null +++ b/v2/rscg_examples/Forged/nuget.txt @@ -0,0 +1 @@ +A fast, strict, and strongly-typed data generator (faker) for C# powered by Source Generators. \ No newline at end of file diff --git a/v2/rscg_examples/Forged/video.json b/v2/rscg_examples/Forged/video.json index 09c4c1c22..8b8539238 100644 --- a/v2/rscg_examples/Forged/video.json +++ b/v2/rscg_examples/Forged/video.json @@ -8,8 +8,8 @@ {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG"}, {"typeStep":"text","arg": "My name is Andrei Ignat and I am deeply fond of Roslyn Source Code Generator. "}, -{"typeStep":"text","arg": "Today I will present Forged . Generating faker data from class ."}, -{"typeStep":"browser","arg":"https://www.nuget.org/packages/Forged/"}, +{"typeStep":"text","arg": "Today I will present Atulin.Forged . Generating faker data from class ."}, +{"typeStep":"browser","arg":"https://www.nuget.org/packages/Atulin.Forged/"}, {"typeStep":"text","arg": "The whole example is here"}, {"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged"}, {"typeStep":"text","arg": "You can download the code from here"}, @@ -19,11 +19,11 @@ {"typeStep":"text","arg": "So , let's start the project with Visual Studio Code "}, {"typeStep":"stepvscode","arg": "-n D:\\gth\\RSCG_Examples\\v2"}, -{"typeStep":"text","arg": "To use it ,you will put the Nuget Forged into the csproj "}, +{"typeStep":"text","arg": "To use it ,you will put the Nuget Atulin.Forged into the csproj "}, {"typeStep":"stepvscode","arg": "-r -g D:\\gth\\RSCG_Examples\\v2\\rscg_examples\\Forged\\src\\TestClock\\TestClock.csproj"}, -{"typeStep":"text","arg": "And now I will show you an example of using Forged"}, +{"typeStep":"text","arg": "And now I will show you an example of using Atulin.Forged"}, {"typeStep":"hide","arg": "now execute the tour in VSCode"}, {"typeStep":"tour", "arg": "src/.tours/"}, diff --git a/v2/rscg_examples_site/docs/Authors/Angius.md b/v2/rscg_examples_site/docs/Authors/Angius.md index d8052f9ff..569dc833b 100644 --- a/v2/rscg_examples_site/docs/Authors/Angius.md +++ b/v2/rscg_examples_site/docs/Authors/Angius.md @@ -3,5 +3,5 @@ Number RSCG: 1 - 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 + 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Atulin.Forged?label=Atulin.Forged)](https://www.nuget.org/packages/Atulin.Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 diff --git a/v2/rscg_examples_site/docs/Categories/Tests.md b/v2/rscg_examples_site/docs/Categories/Tests.md index a850df87c..b5674d0c0 100644 --- a/v2/rscg_examples_site/docs/Categories/Tests.md +++ b/v2/rscg_examples_site/docs/Categories/Tests.md @@ -2,7 +2,7 @@ Number RSCG: 11 - 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 + 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Atulin.Forged?label=Atulin.Forged)](https://www.nuget.org/packages/Atulin.Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 2 [Imposter](/docs/Imposter) [![Nuget](https://img.shields.io/nuget/dt/Imposter?label=Imposter)](https://www.nuget.org/packages/Imposter/) ![GitHub Repo stars](https://img.shields.io/github/stars/themidnightgospel/Imposter?style=social) 2025-12-13 diff --git a/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx b/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx index 2d30dea7c..debdd0657 100644 --- a/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx +++ b/v2/rscg_examples_site/docs/Categories/_PrimitiveTests.mdx @@ -1,6 +1,6 @@ ### Category "Tests" has the following generators: - 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 + 1 [Forged](/docs/Forged) [![Nuget](https://img.shields.io/nuget/dt/Atulin.Forged?label=Atulin.Forged)](https://www.nuget.org/packages/Atulin.Forged/) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) 2026-09-12 2 [Imposter](/docs/Imposter) [![Nuget](https://img.shields.io/nuget/dt/Imposter?label=Imposter)](https://www.nuget.org/packages/Imposter/) ![GitHub Repo stars](https://img.shields.io/github/stars/themidnightgospel/Imposter?style=social) 2025-12-13 diff --git a/v2/rscg_examples_site/docs/RSCG-Examples/Forged.md b/v2/rscg_examples_site/docs/RSCG-Examples/Forged.md index 968b7a11c..33dbab0f6 100644 --- a/v2/rscg_examples_site/docs/RSCG-Examples/Forged.md +++ b/v2/rscg_examples_site/docs/RSCG-Examples/Forged.md @@ -15,7 +15,7 @@ import SameCategory from '../Categories/_PrimitiveTests.mdx'; ## NuGet / site data -[![Nuget](https://img.shields.io/nuget/dt/Forged?label=Forged)](https://www.nuget.org/packages/Forged/) +[![Nuget](https://img.shields.io/nuget/dt/Atulin.Forged?label=Atulin.Forged)](https://www.nuget.org/packages/Atulin.Forged/) [![GitHub last commit](https://img.shields.io/github/last-commit/Atulin/Forged?label=updated)](https://github.com/Atulin/Forged) ![GitHub Repo stars](https://img.shields.io/github/stars/Atulin/Forged?style=social) @@ -26,12 +26,12 @@ import SameCategory from '../Categories/_PrimitiveTests.mdx'; Name: **Forged** - +A fast, strict, and strongly-typed data generator (faker) for C# powered by Source Generators. Author: Angius NuGet: -*https://www.nuget.org/packages/Forged/* +*https://www.nuget.org/packages/Atulin.Forged/* You can find more details at https://github.com/Atulin/Forged diff --git a/v2/rscg_examples_site/static/exports/RSCG.json b/v2/rscg_examples_site/static/exports/RSCG.json index 19e410388..55ce64a87 100644 --- a/v2/rscg_examples_site/static/exports/RSCG.json +++ b/v2/rscg_examples_site/static/exports/RSCG.json @@ -2357,7 +2357,7 @@ { "Name": "Forged", "Link": "https://ignatandrei.github.io/RSCG_Examples/v2/docs/Forged", - "NuGet": "https://www.nuget.org/packages/Forged/", + "NuGet": "https://www.nuget.org/packages/Atulin.Forged/", "Source": "https://github.com/Atulin/Forged", "Category": "Tests", "AddedOn": "2026-09-12T00:00:00"