Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RSCG - 238 Examples of Roslyn Source Code Generators / 15 created by Microsoft /
# RSCG - 239 Examples of Roslyn Source Code Generators / 15 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 238 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 239 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 : 2025-11-07 => 07 November 2025
## Latest Update : 2025-11-08 => 08 November 2025

If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***

Expand All @@ -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 238 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 239 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 15 from Microsoft )
### 239. [TUnit](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit) , in the [Tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) category

Generated on : 2025-11-08 => 08 November 2025

<details>
<summary>Expand</summary>



Author: Tom Longhurst



Nuget: [https://www.nuget.org/packages/TUnit/](https://www.nuget.org/packages/TUnit/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit)

Source: [https://github.com/thomhurst/TUnit](https://github.com/thomhurst/TUnit)

</details>

### 238. [TeCLI](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TeCLI) , in the [CommandLine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) category

Generated on : 2025-11-07 => 07 November 2025
Expand Down
2 changes: 1 addition & 1 deletion later.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Just later

## Latest Update : 2025-11-07 => 07 November 2025
## Latest Update : 2025-11-08 => 08 November 2025



Expand Down
48 changes: 48 additions & 0 deletions v2/.tours/TUnit.tour
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

{
"$schema": "https://aka.ms/codetour-schema",
"title": "TUnit",
"steps":
[
{
"file": "rscg_examples/TUnit/src/TestDemo/TestDemo.csproj",
"description": "First, we add Nuget [TUnit](https://www.nuget.org/packages/TUnit/) in csproj ",
"pattern": "TUnit"
}

,{
"file": "rscg_examples/TUnit/src/TestDemo/FirstTest.cs",
"description": "File FirstTest.cs ",
"pattern": "this is the code"
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern "this is the code" doesn't match any text in the FirstTest.cs file. Based on the file content, this pattern should be removed or changed to match actual code content (e.g., "namespace TestDemo" or "FirstTest").

Suggested change
"pattern": "this is the code"
"pattern": "namespace TestDemo"

Copilot uses AI. Check for mistakes.
}


,{
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.Generators.TestMetadataGenerator/TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs",
"description": "Generated File 4 from 4 : TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs ",
"line": 1
}

,{
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.Generators.AotConverterGenerator/AotConverters.g.cs",
"description": "Generated File 3 from 4 : AotConverters.g.cs ",
"line": 1
}

,{
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.CodeGenerators.DisableReflectionScannerGenerator/DisableReflectionScanner.g.cs",
"description": "Generated File 2 from 4 : DisableReflectionScanner.g.cs ",
"line": 1
}

,{
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.CodeGenerators.AssemblyLoaderGenerator/AssemblyLoader.g.cs",
"description": "Generated File 1 from 4 : AssemblyLoader.g.cs ",
"line": 1
}

],

"ref": "main"

}
3 changes: 2 additions & 1 deletion v2/Generator/MultiGeneratorV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ public string[] SourceNoRSCG()

text = text.Replace("(COVERAGE", $"({d.Generator!.Source}/COVERAGE");
text = text.Replace("(TeCLI.", $"({d.Generator!.Source}/TeCLI.");


text = text.Replace("(assets/banner.", $"({d.Generator!.Source}/assets/banner.");
text = text.Replace("(integ-tests/", $"({d.Generator!.Source}/integ-tests/");
text = text.Replace("(./samples", $"({d.Generator!.Source}/samples");
text = text.Replace("(./tests", $"({d.Generator!.Source}/tests");
Expand Down
1 change: 1 addition & 0 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,4 @@ Nr,Key,Source,Category
236,Validly, https://github.com/Hookyns/validly,Validator
237,Program, https://github.com/dotnet/aspnetcore/,EnhancementClass
238,TeCLI, https://github.com/tyevco/TeCLI,CommandLine
239,TUnit, https://github.com/thomhurst/TUnit,Tests
6 changes: 6 additions & 0 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1441,5 +1441,11 @@
"Category":32,
"dtStart": "2025-11-07T00:00:00",
"show": true
},
{
"ID":"TUnit",
"Category":13,
"dtStart": "2025-11-08T00:00:00",
"show": true
}
]
68 changes: 68 additions & 0 deletions v2/book/examples/TUnit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

<h1>RSCG nr 239 : TUnit</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/TUnit/" target="_blank">https://www.nuget.org/packages/TUnit/</a>

<p>You can find more details at : <a href="https://github.com/thomhurst/TUnit" target="_blank"> https://github.com/thomhurst/TUnit</a></p>

<p>Author :Tom Longhurst</p>

<p>Source: <a href="https://github.com/thomhurst/TUnit" target="_blank">https://github.com/thomhurst/TUnit</a> </p>

<h2>About</h2>

Writing unit tests

<h2>
How to use
</h2>
<h3>
Add reference to the <a href="https://www.nuget.org/packages/TUnit/" target="_blank">TUnit</a> in the csproj
</h3>
<img src="images/TUnit/TestDemo.csproj.png" width="580" height="580" />

<h3>This was for me the <b>starting</b> code</h3>

<br />
I have <b>coded</b> the file FirstTest.cs
<br />
<img src="images/TUnit/csFiles/FirstTest.cs.png" width="580" height="580" />
<hr />
<h3>And here are the <i>generated</i> files</h3>

<br />
The file <i>generated</i> is AssemblyLoader.g.cs
<br />
<img src="images/TUnit/generated/AssemblyLoader.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is DisableReflectionScanner.g.cs
<br />
<img src="images/TUnit/generated/DisableReflectionScanner.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is AotConverters.g.cs
<br />
<img src="images/TUnit/generated/AotConverters.g.cs.png" width="580" height="580" />

<br />
The file <i>generated</i> is TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs
<br />
<img src="images/TUnit/generated/TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs.png" width="580" height="580" />

<p>
You can download the code and this page as pdf from
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit
</a>
</p>


<p>
You can see the whole list at
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
</a>
</p>

6 changes: 5 additions & 1 deletion v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 238 RSCG with examples =>
This is the list of 239 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -978,6 +978,10 @@ <h1>
<td>238</td>
<td><a href="examples/TeCLI.html">TeCLI</a></td>
</tr>
<tr>
<td>239</td>
<td><a href="examples/TUnit.html">TUnit</a></td>
</tr>
</table>


Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ input-files:
- examples/validly.html
- examples/Program.html
- examples/TeCLI.html
- examples/TUnit.html

# or you may use input-file: with a single value
# defaults:
Expand Down
22 changes: 22 additions & 0 deletions v2/rscg_examples/TUnit/description.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"generator":{
"name":"TUnit",
"nuget":[
"https://www.nuget.org/packages/TUnit/"
],
"link":"https://github.com/thomhurst/TUnit",
"author":"Tom Longhurst",
"source":"https://github.com/thomhurst/TUnit"
},
"data":{
"goodFor":["Writing unit tests"],
"csprojDemo":"TestDemo.csproj",
"csFiles":["FirstTest.cs"],
"excludeDirectoryGenerated":[""],
"includeAdditionalFiles":[""]
},
"links":{
"blog":"",
"video":""
}
}
Loading
Loading