Пример #1
0
        [Fact] // https://github.com/dotnet/runtime/issues/36415
        public void VerifyInMemoryDirectoryInfo_IsNotEmpty()
        {
            IEnumerable <string>             files = new[] { @"pagefile.sys" };
            InMemoryDirectoryInfo            directoryInfo;
            IEnumerable <FileSystemInfoBase> fileSystemInfos;

            if (PlatformDetection.IsWindows)
            {
                directoryInfo   = new InMemoryDirectoryInfo(@"C:\", files);
                fileSystemInfos = directoryInfo.EnumerateFileSystemInfos();

                Assert.Equal(1, fileSystemInfos.Count());
            }

            directoryInfo   = new InMemoryDirectoryInfo("/", files);
            fileSystemInfos = directoryInfo.EnumerateFileSystemInfos();

            Assert.Equal(1, fileSystemInfos.Count());
        }