Skip to content

Commit ff768f6

Browse files
authored
Merge pull request #427 from ignatandrei/424-tunit
2 parents 54e5188 + f75fddb commit ff768f6

File tree

25 files changed

+1594
-15
lines changed

25 files changed

+1594
-15
lines changed

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# RSCG - 238 Examples of Roslyn Source Code Generators / 15 created by Microsoft /
1+
# RSCG - 239 Examples of Roslyn Source Code Generators / 15 created by Microsoft /
22

3-
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.
3+
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.
44

55
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
66

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

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

@@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt
2424

2525
## Content
2626

27-
Those are the 238 Roslyn Source Code Generators that I have tested you can see and download source code example.
27+
Those are the 239 Roslyn Source Code Generators that I have tested you can see and download source code example.
2828
( including 15 from Microsoft )
29+
### 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
30+
31+
Generated on : 2025-11-08 => 08 November 2025
32+
33+
<details>
34+
<summary>Expand</summary>
35+
36+
37+
38+
Author: Tom Longhurst
39+
40+
41+
42+
Nuget: [https://www.nuget.org/packages/TUnit/](https://www.nuget.org/packages/TUnit/)
43+
44+
45+
Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit](https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit)
46+
47+
Source: [https://github.com/thomhurst/TUnit](https://github.com/thomhurst/TUnit)
48+
49+
</details>
50+
2951
### 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
3052

3153
Generated on : 2025-11-07 => 07 November 2025

later.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Just later
22

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

55

66

v2/.tours/TUnit.tour

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
{
3+
"$schema": "https://aka.ms/codetour-schema",
4+
"title": "TUnit",
5+
"steps":
6+
[
7+
{
8+
"file": "rscg_examples/TUnit/src/TestDemo/TestDemo.csproj",
9+
"description": "First, we add Nuget [TUnit](https://www.nuget.org/packages/TUnit/) in csproj ",
10+
"pattern": "TUnit"
11+
}
12+
13+
,{
14+
"file": "rscg_examples/TUnit/src/TestDemo/FirstTest.cs",
15+
"description": "File FirstTest.cs ",
16+
"pattern": "this is the code"
17+
}
18+
19+
20+
,{
21+
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.Generators.TestMetadataGenerator/TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs",
22+
"description": "Generated File 4 from 4 : TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs ",
23+
"line": 1
24+
}
25+
26+
,{
27+
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.Generators.AotConverterGenerator/AotConverters.g.cs",
28+
"description": "Generated File 3 from 4 : AotConverters.g.cs ",
29+
"line": 1
30+
}
31+
32+
,{
33+
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.CodeGenerators.DisableReflectionScannerGenerator/DisableReflectionScanner.g.cs",
34+
"description": "Generated File 2 from 4 : DisableReflectionScanner.g.cs ",
35+
"line": 1
36+
}
37+
38+
,{
39+
"file": "rscg_examples/TUnit/src/TestDemo/obj/GX/TUnit.Core.SourceGenerator/TUnit.Core.SourceGenerator.CodeGenerators.AssemblyLoaderGenerator/AssemblyLoader.g.cs",
40+
"description": "Generated File 1 from 4 : AssemblyLoader.g.cs ",
41+
"line": 1
42+
}
43+
44+
],
45+
46+
"ref": "main"
47+
48+
}

v2/Generator/MultiGeneratorV2.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ public string[] SourceNoRSCG()
127127

128128
text = text.Replace("(COVERAGE", $"({d.Generator!.Source}/COVERAGE");
129129
text = text.Replace("(TeCLI.", $"({d.Generator!.Source}/TeCLI.");
130-
130+
131+
text = text.Replace("(assets/banner.", $"({d.Generator!.Source}/assets/banner.");
131132
text = text.Replace("(integ-tests/", $"({d.Generator!.Source}/integ-tests/");
132133
text = text.Replace("(./samples", $"({d.Generator!.Source}/samples");
133134
text = text.Replace("(./tests", $"({d.Generator!.Source}/tests");

v2/Generator/all.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,4 @@ Nr,Key,Source,Category
237237
236,Validly, https://github.com/Hookyns/validly,Validator
238238
237,Program, https://github.com/dotnet/aspnetcore/,EnhancementClass
239239
238,TeCLI, https://github.com/tyevco/TeCLI,CommandLine
240+
239,TUnit, https://github.com/thomhurst/TUnit,Tests

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,5 +1441,11 @@
14411441
"Category":32,
14421442
"dtStart": "2025-11-07T00:00:00",
14431443
"show": true
1444+
},
1445+
{
1446+
"ID":"TUnit",
1447+
"Category":13,
1448+
"dtStart": "2025-11-08T00:00:00",
1449+
"show": true
14441450
}
14451451
]

v2/book/examples/TUnit.html

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
2+
<h1>RSCG nr 239 : TUnit</h1>
3+
4+
<h2>Info</h2>
5+
Nuget : <a href="https://www.nuget.org/packages/TUnit/" target="_blank">https://www.nuget.org/packages/TUnit/</a>
6+
7+
<p>You can find more details at : <a href="https://github.com/thomhurst/TUnit" target="_blank"> https://github.com/thomhurst/TUnit</a></p>
8+
9+
<p>Author :Tom Longhurst</p>
10+
11+
<p>Source: <a href="https://github.com/thomhurst/TUnit" target="_blank">https://github.com/thomhurst/TUnit</a> </p>
12+
13+
<h2>About</h2>
14+
15+
Writing unit tests
16+
17+
<h2>
18+
How to use
19+
</h2>
20+
<h3>
21+
Add reference to the <a href="https://www.nuget.org/packages/TUnit/" target="_blank">TUnit</a> in the csproj
22+
</h3>
23+
<img src="images/TUnit/TestDemo.csproj.png" width="580" height="580" />
24+
25+
<h3>This was for me the <b>starting</b> code</h3>
26+
27+
<br />
28+
I have <b>coded</b> the file FirstTest.cs
29+
<br />
30+
<img src="images/TUnit/csFiles/FirstTest.cs.png" width="580" height="580" />
31+
<hr />
32+
<h3>And here are the <i>generated</i> files</h3>
33+
34+
<br />
35+
The file <i>generated</i> is AssemblyLoader.g.cs
36+
<br />
37+
<img src="images/TUnit/generated/AssemblyLoader.g.cs.png" width="580" height="580" />
38+
39+
<br />
40+
The file <i>generated</i> is DisableReflectionScanner.g.cs
41+
<br />
42+
<img src="images/TUnit/generated/DisableReflectionScanner.g.cs.png" width="580" height="580" />
43+
44+
<br />
45+
The file <i>generated</i> is AotConverters.g.cs
46+
<br />
47+
<img src="images/TUnit/generated/AotConverters.g.cs.png" width="580" height="580" />
48+
49+
<br />
50+
The file <i>generated</i> is TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs
51+
<br />
52+
<img src="images/TUnit/generated/TestDemo_FirstTest_Add_WithTwoNumbers_ReturnsSum.g.cs.png" width="580" height="580" />
53+
54+
<p>
55+
You can download the code and this page as pdf from
56+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit'>
57+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/TUnit
58+
</a>
59+
</p>
60+
61+
62+
<p>
63+
You can see the whole list at
64+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
65+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
66+
</a>
67+
</p>
68+

v2/book/list.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</head>
1818
<body>
1919
<h1>
20-
This is the list of 238 RSCG with examples =>
20+
This is the list of 239 RSCG with examples =>
2121
</h1>
2222

2323
<table >
@@ -978,6 +978,10 @@ <h1>
978978
<td>238</td>
979979
<td><a href="examples/TeCLI.html">TeCLI</a></td>
980980
</tr>
981+
<tr>
982+
<td>239</td>
983+
<td><a href="examples/TUnit.html">TUnit</a></td>
984+
</tr>
981985
</table>
982986

983987

v2/book/pandocHTML.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ input-files:
252252
- examples/validly.html
253253
- examples/Program.html
254254
- examples/TeCLI.html
255+
- examples/TUnit.html
255256

256257
# or you may use input-file: with a single value
257258
# defaults:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"generator":{
3+
"name":"TUnit",
4+
"nuget":[
5+
"https://www.nuget.org/packages/TUnit/"
6+
],
7+
"link":"https://github.com/thomhurst/TUnit",
8+
"author":"Tom Longhurst",
9+
"source":"https://github.com/thomhurst/TUnit"
10+
},
11+
"data":{
12+
"goodFor":["Writing unit tests"],
13+
"csprojDemo":"TestDemo.csproj",
14+
"csFiles":["FirstTest.cs"],
15+
"excludeDirectoryGenerated":[""],
16+
"includeAdditionalFiles":[""]
17+
},
18+
"links":{
19+
"blog":"",
20+
"video":""
21+
}
22+
}

0 commit comments

Comments
 (0)