File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 <PackageReference Include =" XunitContext" Version =" 1.9.1" />
2020 <ProjectReference Include =" ..\DiffEngine\DiffEngine.csproj" />
2121 </ItemGroup >
22+ <ItemGroup >
23+ <Folder Include =" DirForSearch\dir1\" />
24+ </ItemGroup >
2225</Project >
Original file line number Diff line number Diff line change 1+
Original file line number Diff line number Diff line change 1- using System . IO ;
1+ using System ;
2+ using System . IO ;
23using Xunit ;
34using Xunit . Abstractions ;
45
56public class WildcardFileFinderTests :
67 XunitContextBase
78{
9+ [ Fact ]
10+ public void MultiMatchDir_order1 ( )
11+ {
12+ var dir1 = Path . Combine ( SourceDirectory , @"DirForSearch\dir1" ) ;
13+ var dir2 = Path . Combine ( SourceDirectory , @"DirForSearch\dir2" ) ;
14+ Directory . SetLastWriteTime ( dir2 , DateTime . Now . AddDays ( - 1 ) ) ;
15+ Directory . SetLastWriteTime ( dir1 , DateTime . Now ) ;
16+ var path = Path . Combine ( SourceDirectory , @"DirForSearch\*\TextFile1.txt" ) ;
17+ Assert . True ( WildcardFileFinder . TryFind ( path , out var result ) ) ;
18+ Assert . True ( File . Exists ( result ) ) ;
19+ }
20+
21+ [ Fact ]
22+ public void MultiMatchDir_order2 ( )
23+ {
24+ var dir1 = Path . Combine ( SourceDirectory , @"DirForSearch\dir1" ) ;
25+ var dir2 = Path . Combine ( SourceDirectory , @"DirForSearch\dir2" ) ;
26+ Directory . SetLastWriteTime ( dir1 , DateTime . Now . AddDays ( - 1 ) ) ;
27+ Directory . SetLastWriteTime ( dir2 , DateTime . Now ) ;
28+ var path = Path . Combine ( SourceDirectory , @"DirForSearch\*\TextFile1.txt" ) ;
29+ Assert . True ( WildcardFileFinder . TryFind ( path , out var result ) ) ;
30+ Assert . True ( File . Exists ( result ) ) ;
31+ }
32+
833 [ Fact ]
934 public void FullFilePath ( )
1035 {
You can’t perform that action at this time.
0 commit comments