コード例 #1
0
        public void TryGetDirInfo_without_slash()
        {
            var provider = new EmbeddedResourceFileSystem(this.GetType().Assembly, "");

            IEnumerable <IFileInfo> files;

            provider.TryGetDirectoryContents(string.Empty, out files).ShouldBe(false);
            provider.TryGetDirectoryContents("file", out files).ShouldBe(false);
            provider.TryGetDirectoryContents("file.txt", out files).ShouldBe(false);
        }
コード例 #2
0
        public void TryGetDirInfo_with_no_matching_base_namespace()
        {
            var provider = new EmbeddedResourceFileSystem(this.GetType().Assembly, "Unknown.Namespace");

            IEnumerable <IFileInfo> files;

            provider.TryGetDirectoryContents(string.Empty, out files).ShouldBe(false);
            provider.TryGetDirectoryContents("/", out files).ShouldBe(true);
            files.Count().ShouldBe(0);
        }
コード例 #3
0
        public void TryGetDirInfo_with_slash()
        {
            var provider = new EmbeddedResourceFileSystem(this.GetType().Assembly, "Resources");

            IEnumerable <IFileInfo> files;

            provider.TryGetDirectoryContents("/", out files).ShouldBe(true);
            files.Count().ShouldBe(2);

            provider.TryGetDirectoryContents("/file", out files).ShouldBe(false);
            provider.TryGetDirectoryContents("/file/", out files).ShouldBe(false);
            provider.TryGetDirectoryContents("/file.txt", out files).ShouldBe(false);
            provider.TryGetDirectoryContents("/file/txt", out files).ShouldBe(false);
        }