Skip to content

Commit f164dc3

Browse files
committed
Fix test
1 parent 6cc6a0c commit f164dc3

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

tests/Foundatio.Mediator.Tests/BasicHandlerGenerationTests.GeneratesWrapperForSimpleHandler.verified.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
HintName: InterceptsLocationAttribute.g.cs,
77
Source:
8-
// This file was generated by Foundatio.Mediator source generators.
8+
// Generated by Foundatio.Mediator v<version>
99
// Changes to this file may be lost when the code is regenerated.
1010
// </auto-generated>
1111

@@ -48,7 +48,7 @@ internal sealed class InterceptsLocationAttribute : global::System.Attribute
4848
{
4949
HintName: PingHandler_Ping_Handler.g.cs,
5050
Source:
51-
// This file was generated by Foundatio.Mediator source generators.
51+
// Generated by Foundatio.Mediator v<version>
5252
// Changes to this file may be lost when the code is regenerated.
5353
// </auto-generated>
5454

@@ -121,7 +121,7 @@ internal static class PingHandler_Ping_Handler
121121
{
122122
HintName: Tests_FoundatioModuleAttribute.g.cs,
123123
Source:
124-
// This file was generated by Foundatio.Mediator source generators.
124+
// Generated by Foundatio.Mediator v<version>
125125
// Changes to this file may be lost when the code is regenerated.
126126
// </auto-generated>
127127

@@ -134,7 +134,7 @@ internal static class PingHandler_Ping_Handler
134134
{
135135
HintName: Tests_MediatorHandlers.g.cs,
136136
Source:
137-
// This file was generated by Foundatio.Mediator source generators.
137+
// Generated by Foundatio.Mediator v<version>
138138
// Changes to this file may be lost when the code is regenerated.
139139
// </auto-generated>
140140

tests/Foundatio.Mediator.Tests/GeneratorTestBase.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,19 @@ await Verify(new
3838
.ScrubLines(l => l.Contains("// <auto-generated>"))
3939
.AddScrubber(sb =>
4040
{
41-
string replaced = Regex.Replace(sb.ToString(),
41+
var text = sb.ToString();
42+
43+
// Scrub GeneratedCode attribute version
44+
text = Regex.Replace(text,
4245
@"GeneratedCode\(""Foundatio\.Mediator"",\s*""[^""]+""\)",
4346
"GeneratedCode(\"Foundatio.Mediator\", \"<version>\")");
44-
sb.Clear().Append(replaced);
47+
48+
// Scrub header comment version
49+
text = Regex.Replace(text,
50+
@"// Generated by Foundatio\.Mediator v[^\r\n]+",
51+
"// Generated by Foundatio.Mediator v<version>");
52+
53+
sb.Clear().Append(text);
4554
});
4655
}
4756

0 commit comments

Comments
 (0)