@@ -405,7 +405,7 @@ public Task Newlines() =>
405405 [ Fact ]
406406 public async Task TrailingNewlinesRaw ( )
407407 {
408- var file = Path . Combine ( FileEx . GetFileDirectory ( ) , "Tests.TrailingNewlinesRaw.verified.txt" ) ;
408+ var file = CurrentFile . Relative ( "Tests.TrailingNewlinesRaw.verified.txt" ) ;
409409 File . Delete ( file ) ;
410410 var settings = new VerifySettings ( ) ;
411411 settings . DisableRequireUniquePrefix ( ) ;
@@ -434,7 +434,7 @@ public async Task TrailingNewlinesRaw()
434434 [ Fact ( Skip = "TODO" ) ]
435435 public async Task TrailingNewlinesObject ( )
436436 {
437- var file = Path . Combine ( FileEx . GetFileDirectory ( ) , "Tests.TrailingNewlinesObject.verified.txt" ) ;
437+ var file = CurrentFile . Relative ( "Tests.TrailingNewlinesObject.verified.txt" ) ;
438438 var settings = new VerifySettings ( ) ;
439439 settings . DisableRequireUniquePrefix ( ) ;
440440 var target = new
@@ -457,9 +457,8 @@ public async Task TrailingNewlinesObject()
457457 [ Fact ]
458458 public async Task DanglingFiles ( )
459459 {
460- var directory = FileEx . GetFileDirectory ( ) ;
461- var receivedFile = Path . Combine ( directory , $ "Tests.DanglingFiles.{ Namer . RuntimeAndVersion } .received.txt") ;
462- var verifiedFile = Path . Combine ( directory , $ "Tests.DanglingFiles.{ Namer . RuntimeAndVersion } .01.verified.txt") ;
460+ var receivedFile = CurrentFile . Relative ( $ "Tests.DanglingFiles.{ Namer . RuntimeAndVersion } .received.txt") ;
461+ var verifiedFile = CurrentFile . Relative ( $ "Tests.DanglingFiles.{ Namer . RuntimeAndVersion } .01.verified.txt") ;
463462 File . WriteAllText ( receivedFile , "" ) ;
464463 File . WriteAllText ( verifiedFile , "" ) ;
465464 await Verify ( "value" )
@@ -473,9 +472,8 @@ await Verify("value")
473472 [ InlineData ( "param" ) ]
474473 public async Task DanglingFilesIgnoreParametersForVerified ( string param )
475474 {
476- var directory = FileEx . GetFileDirectory ( ) ;
477- var receivedFile = Path . Combine ( directory , $ "Tests.DanglingFilesIgnoreParametersForVerified_param=param.{ Namer . RuntimeAndVersion } .01.received.txt") ;
478- var verifiedFile = Path . Combine ( directory , $ "Tests.DanglingFilesIgnoreParametersForVerified.{ Namer . RuntimeAndVersion } .01.verified.txt") ;
475+ var receivedFile = CurrentFile . Relative ( $ "Tests.DanglingFilesIgnoreParametersForVerified_param=param.{ Namer . RuntimeAndVersion } .01.received.txt") ;
476+ var verifiedFile = CurrentFile . Relative ( $ "Tests.DanglingFilesIgnoreParametersForVerified.{ Namer . RuntimeAndVersion } .01.verified.txt") ;
479477 File . WriteAllText ( receivedFile , "" ) ;
480478 File . WriteAllText ( verifiedFile , "" ) ;
481479 await Verify ( "value" )
@@ -690,26 +688,21 @@ public Task VerifyBytesAsync()
690688#endif
691689
692690#if NET6_0
691+
693692 [ Fact ]
694693 public async Task VerifyFilePath ( )
695694 {
696695 await VerifyFile ( "sample.txt" ) ;
697696 Assert . False ( FileEx . IsFileLocked ( "sample.txt" ) ) ;
698697 }
698+
699699#endif
700700
701701 [ Fact ]
702702 public Task VerifyFileWithAppend ( ) =>
703703 VerifyFile ( "sample.txt" )
704704 . AppendValue ( "key" , "value" ) ;
705705
706- #region GetFilePath
707-
708- string GetFilePath ( [ CallerFilePath ] string sourceFile = "" ) =>
709- sourceFile ;
710-
711- #endregion
712-
713706 //[Fact(Skip = "explicit")]
714707 //public async Task ShouldUseExtraSettings()
715708 //{
0 commit comments