File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
sdk/core/Azure.Core.TestFramework/src Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,12 @@ public void TearDownRecordedTestClass()
352352 // Clean up unused test files
353353 if ( Mode == RecordedTestMode . Record )
354354 {
355+ var testClassDirectory = new DirectoryInfo( GetSessionFileDirectory ( ) ) ;
356+ if ( ! testClassDirectory . Exists )
357+ {
358+ return ;
359+ }
360+
355361 var knownMethods = new HashSet< string > ( ) ;
356362
357363 // Management tests record in ctor
@@ -373,7 +379,7 @@ public void TearDownRecordedTestClass()
373379 knownMethods . Add ( method . Name ) ;
374380 }
375381
376- foreach ( var fileInfo in new DirectoryInfo ( GetSessionFileDirectory ( ) ) . EnumerateFiles ( ) )
382+ foreach ( var fileInfo in testClassDirectory . EnumerateFiles ( ) )
377383 {
378384 bool used = knownMethods. Any ( knownMethod => fileInfo . Name . StartsWith ( knownMethod , StringComparison . CurrentCulture ) ) ;
379385
You can’t perform that action at this time.
0 commit comments