@@ -55,6 +55,26 @@ public void OrderShouldNotMessWithAddTool()
5555 Assert . Equal ( "MyCustomDiffTool" , forExtension . Name ) ;
5656 }
5757
58+ [ Fact ]
59+ public void TextConvention ( )
60+ {
61+ var diffToolPath = FakeDiffTool . Exe ;
62+ DiffTools . AddTool (
63+ name : "MyCustomDiffTool" ,
64+ autoRefresh : true ,
65+ isMdi : false ,
66+ supportsText : true ,
67+ requiresTarget : true ,
68+ launchArguments : new (
69+ Left : ( tempFile , targetFile ) => $ "\" { targetFile } \" \" { tempFile } \" ",
70+ Right : ( tempFile , targetFile ) => $ "\" { tempFile } \" \" { targetFile } \" ") ,
71+ exePath : diffToolPath ,
72+ binaryExtensions : [ ] ) ;
73+ var combine = Path . Combine ( SourceDirectory , "input.temp.txtConvention" ) ;
74+ Assert . True ( DiffTools . TryFindForInputFilePath ( combine , out var tool ) ) ;
75+ Assert . Equal ( "MyCustomDiffTool" , tool . Name ) ;
76+ }
77+
5878#if DEBUG
5979 [ Fact ]
6080 public void AddToolBasedOn ( )
@@ -99,34 +119,42 @@ public Task LaunchSpecificImageDiff() =>
99119 DiffRunner.LaunchAsync(DiffTool.P4Merge,
100120 Path.Combine(SourceDirectory, "input.temp.png"),
101121 Path.Combine(SourceDirectory, "input.target.png"));
102- **/
103- // [Fact]
104- // public async Task LaunchImageDiff()
105- // {
106- // foreach (var tool in DiffTools.Resolved)
107- // {
108- // await DiffRunner.LaunchAsync(tool,
109- // Path.Combine(SourceDirectory, "input.temp.png"),
110- // Path.Combine(SourceDirectory, "input.target.png"));
111- // }
112- // }
113-
114- // [Fact]
115- // public async Task LaunchTextDiff()
116- // {
117- // foreach (var tool in DiffTools.Resolved)
118- // {
119- // await DiffRunner.LaunchAsync(tool,
120- // Path.Combine(SourceDirectory, "input.temp.txt"),
121- // Path.Combine(SourceDirectory, "input.target.txt"));
122- // }
123- // }
124- /**
122+
123+ [Fact]
124+ public async Task LaunchImageDiff()
125+ {
126+ foreach (var tool in DiffTools.Resolved)
127+ {
128+ await DiffRunner.LaunchAsync(tool,
129+ Path.Combine(SourceDirectory, "input.temp.png"),
130+ Path.Combine(SourceDirectory, "input.target.png"));
131+ }
132+ }
133+
134+ [Fact]
135+ public async Task LaunchTextDiff()
136+ {
137+ foreach (var tool in DiffTools.Resolved)
138+ {
139+ await DiffRunner.LaunchAsync(tool,
140+ Path.Combine(SourceDirectory, "input.temp.txt"),
141+ Path.Combine(SourceDirectory, "input.target.txt"));
142+ }
143+ }
144+
125145 [Fact]
126146 public Task LaunchSpecificTextDiff() =>
127147 DiffRunner.LaunchAsync(DiffTool.WinMerge,
128148 Path.Combine(SourceDirectory, "input.temp.txt"),
129149 Path.Combine(SourceDirectory, "input.target.txt"));
150+
151+ [Fact]
152+ public Task TextFileConvention()
153+ {
154+ var tempFile = Path.Combine(SourceDirectory, "input.temp.txtConvention");
155+ var targetFile = Path.Combine(SourceDirectory, "input.target.txtConvention");
156+ return DiffRunner.LaunchAsync(tempFile, targetFile);
157+ }
130158 **/
131159
132160 //todo: re enable tests with fake diff tool.
@@ -167,8 +195,7 @@ public void TryFindByName()
167195 }
168196#endif
169197**/
170- public DiffToolsTest ( ITestOutputHelper output )
171- :
198+ public DiffToolsTest ( ITestOutputHelper output ) :
172199 base ( output ) =>
173200 DiffTools . Reset ( ) ;
174201}
0 commit comments