public void GetFiles_EmptyDirectory_NoFilesFound() { Directory.CreateDirectory("tmp"); var files = WildCardFileSearch.GetFiles(Path.Combine("tmp", "*")).ToArray(); Assert.Empty(files); Directory.Delete("tmp"); }
public void GetFiles_UncPath_NoFilesFound() { var files = WildCardFileSearch.GetFiles(@"\\DoesNotExist\*.xml").ToArray(); Assert.Empty(files); }
public void GetFiles_RelativePath_DllFound() { var files = WildCardFileSearch.GetFiles("..\\*\\*.dll").ToArray(); Assert.Contains(files, f => f.EndsWith(this.GetType().Assembly.GetName().Name + ".dll", StringComparison.OrdinalIgnoreCase)); }
public void GetFiles_MultiDirectory_MatchingFilesFound() { var files = WildCardFileSearch.GetFiles(Path.Combine(FileManager.GetFilesDirectory(), "CSharp", "*roject*", "*lyzer*.cs")).ToArray(); Assert.Single(files); }
public void GetFiles_MultiDirectory_AllFilesFound() { var files = WildCardFileSearch.GetFiles(Path.Combine(FileManager.GetFilesDirectory(), "*", "*", "*")).ToArray(); Assert.True(files.Length >= 39); }
public void GetFiles_SingleDirectory_XmlFilesFound() { var files = WildCardFileSearch.GetFiles(Path.Combine(FileManager.GetCSharpReportDirectory(), "*.xml")).ToArray(); Assert.Equal(20, files.Length); }
public void GetFiles_OnlyUNCPathWithoutFilePattern_ArgumentException() { Assert.Throws <ArgumentException>(() => WildCardFileSearch.GetFiles("\\test").ToArray()); }
public void GetFiles_OnlyDriveWithoutFilePattern_ArgumentException() { Assert.Throws <ArgumentException>(() => WildCardFileSearch.GetFiles("C:\\").ToArray()); }
public void GetFiles_FilePatternInvalid_ArgumentException() { Assert.Throws <ArgumentException>(() => WildCardFileSearch.GetFiles("\t").ToArray()); }
public void GetFiles_FilePatternEmtpy_ArgumentException() { Assert.Throws <ArgumentException>(() => WildCardFileSearch.GetFiles(string.Empty).ToArray()); }
public void GetFiles_FilePatternNull_ArgumentException() { Assert.Throws <ArgumentException>(() => WildCardFileSearch.GetFiles(null).ToArray()); }