@@ -405,7 +405,7 @@ public Task Newlines() =>
405
405
[ Fact ]
406
406
public async Task TrailingNewlinesRaw ( )
407
407
{
408
- var file = Path . Combine ( FileEx . GetFileDirectory ( ) , "Tests.TrailingNewlinesRaw.verified.txt" ) ;
408
+ var file = CurrentFile . Relative ( "Tests.TrailingNewlinesRaw.verified.txt" ) ;
409
409
File . Delete ( file ) ;
410
410
var settings = new VerifySettings ( ) ;
411
411
settings . DisableRequireUniquePrefix ( ) ;
@@ -434,7 +434,7 @@ public async Task TrailingNewlinesRaw()
434
434
[ Fact ( Skip = "TODO" ) ]
435
435
public async Task TrailingNewlinesObject ( )
436
436
{
437
- var file = Path . Combine ( FileEx . GetFileDirectory ( ) , "Tests.TrailingNewlinesObject.verified.txt" ) ;
437
+ var file = CurrentFile . Relative ( "Tests.TrailingNewlinesObject.verified.txt" ) ;
438
438
var settings = new VerifySettings ( ) ;
439
439
settings . DisableRequireUniquePrefix ( ) ;
440
440
var target = new
@@ -457,9 +457,8 @@ public async Task TrailingNewlinesObject()
457
457
[ Fact ]
458
458
public async Task DanglingFiles ( )
459
459
{
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") ;
463
462
File . WriteAllText ( receivedFile , "" ) ;
464
463
File . WriteAllText ( verifiedFile , "" ) ;
465
464
await Verify ( "value" )
@@ -473,9 +472,8 @@ await Verify("value")
473
472
[ InlineData ( "param" ) ]
474
473
public async Task DanglingFilesIgnoreParametersForVerified ( string param )
475
474
{
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") ;
479
477
File . WriteAllText ( receivedFile , "" ) ;
480
478
File . WriteAllText ( verifiedFile , "" ) ;
481
479
await Verify ( "value" )
@@ -690,26 +688,21 @@ public Task VerifyBytesAsync()
690
688
#endif
691
689
692
690
#if NET6_0
691
+
693
692
[ Fact ]
694
693
public async Task VerifyFilePath ( )
695
694
{
696
695
await VerifyFile ( "sample.txt" ) ;
697
696
Assert . False ( FileEx . IsFileLocked ( "sample.txt" ) ) ;
698
697
}
698
+
699
699
#endif
700
700
701
701
[ Fact ]
702
702
public Task VerifyFileWithAppend ( ) =>
703
703
VerifyFile ( "sample.txt" )
704
704
. AppendValue ( "key" , "value" ) ;
705
705
706
- #region GetFilePath
707
-
708
- string GetFilePath ( [ CallerFilePath ] string sourceFile = "" ) =>
709
- sourceFile ;
710
-
711
- #endregion
712
-
713
706
//[Fact(Skip = "explicit")]
714
707
//public async Task ShouldUseExtraSettings()
715
708
//{
0 commit comments