Skip to content

Commit 8356ecd

Browse files
author
marhoily
committed
Add test, output
1 parent a6d8311 commit 8356ecd

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Generaid.Tests/FixerFacts.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ public void FactMethodName()
1313
.Should().Be("...<LastGenOutput>WrapperInterfaceHost.g.cs</LastGenOutput>...");
1414
}
1515
[Fact]
16+
public void FactMethodName_3()
17+
{
18+
Program.Fix("...<LastGenOutput>WrapperInterfaceHost.g.cs</LastGenOutput>...<LastGenOutput>WrapperInterfaceHost.cs</LastGenOutput>...")
19+
.Should().Be("...<LastGenOutput>WrapperInterfaceHost.g.cs</LastGenOutput>...<LastGenOutput>WrapperInterfaceHost.g.cs</LastGenOutput>...");
20+
}
21+
[Fact]
1622
public void FactMethodName2()
1723
{
1824
Program.Fix("...<LastGenOutput>WrapperInterfaceHost.cs")

GeneratedFileNamesFixer/Program.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,23 @@ public static class Program
1212
static void Main()
1313
{
1414
var projectFiles = Directory.EnumerateFiles(
15-
Environment.CurrentDirectory, "*.csproj");
15+
Environment.CurrentDirectory, "*.csproj", SearchOption.AllDirectories);
1616
foreach (var file in projectFiles)
1717
{
18+
Console.Write(file + "...");
1819
var oldText = File.ReadAllText(file);
1920
var newText = Fix(oldText);
2021
if (oldText != newText)
22+
{
2123
File.WriteAllText(file, newText);
24+
Console.Write("Fixed");
25+
}
26+
else
27+
{
28+
Console.Write("<null>");
29+
}
2230
}
31+
2332
}
2433

2534
public static string Fix(string input)

0 commit comments

Comments
 (0)