@@ -52,10 +52,10 @@ public string AddFile(string fileName, string content)
5252 return path ;
5353 }
5454
55- public void AddFileComparison ( string expectedContent , string actualContent , string extension )
55+ public void AddFileComparison ( string expectedContent , string actualContent , string outputName , string extension )
5656 {
57- this . EnsureFileComparisonContent ( this . _expectedDirectory , extension , expectedContent ) ;
58- this . EnsureFileComparisonContent ( this . _actualDirectory , extension , actualContent ) ;
57+ this . EnsureFileComparisonContent ( this . _expectedDirectory , outputName , extension , expectedContent ) ;
58+ this . EnsureFileComparisonContent ( this . _actualDirectory , outputName , extension , actualContent ) ;
5959 this . EnsureWinMergeStarter ( ) ;
6060 }
6161
@@ -89,11 +89,21 @@ string FormatContent(EventLogEntry entry)
8989 . Take ( count )
9090 . Each ( ( x , i ) => this . AddFile ( $ "EventLogEntry_{ i + 1 } _{ x . EntryType } .txt", FormatContent ( x ) ) ) ;
9191 }
92-
93- private void EnsureFileComparisonContent ( string directory , string extension , string content )
92+
93+ private void EnsureFileComparisonContent ( string path , string outputName , string extension , string content )
9494 {
95- this . EnsureFileComparisonContent ( Path . Combine ( directory , $ "{ this . _testContext . TestName } .{ extension } ") , content ) ;
96- this . EnsureFileComparisonContent ( Path . Combine ( this . TestDirectory , $ "{ new DirectoryInfo ( directory ) . Name } .{ extension } ") , content ) ;
95+ DirectoryInfo directory = new DirectoryInfo ( path ) ;
96+ string fileName = outputName ;
97+ string alternativeFileName = directory . Name ;
98+
99+ if ( ! String . IsNullOrEmpty ( extension ) )
100+ {
101+ fileName = $ "{ fileName } .{ extension } ";
102+ alternativeFileName = $ "{ alternativeFileName } .{ extension } ";
103+ }
104+
105+ this . EnsureFileComparisonContent ( Path . Combine ( path , fileName ) , content ) ;
106+ this . EnsureFileComparisonContent ( Path . Combine ( this . TestDirectory , alternativeFileName ) , content ) ;
97107 }
98108 private void EnsureFileComparisonContent ( string path , string content )
99109 {
0 commit comments