Exemple #1
0
        public void Files_UnknownDirectory_ReturnsEmptyList()
        {
            var lister = new FileLister(@"c:\foo\bar\baz", ".doc");

            var files = lister.Files;

            files.Should().BeEmpty();
        }
Exemple #2
0
        public void Files_ExistingDirectory_ListsAllEntries()
        {
            foreach (var file in filesToCreate)
            {
                File.WriteAllText(Path.Combine(TemporaryDirectoryToStoreTestData, file), "content");
            }
            var lister = new FileLister(TemporaryDirectoryToStoreTestData, ".doc");

            var files = lister.Files;

            files.Should().NotBeEmpty();
            files.Select(f => f.Name).Should().Contain("test1.docx");
            files.Select(f => f.Name).Should().Contain("test2.docx");
            files.Select(f => f.Name).Should().NotContain("test1.exe");
        }