コード例 #1
0
 static bool GetCdRomDirectories(string[] args)
 {
     foreach (var d in physFS.GetCdRomDirs())
     {
         Console.WriteLine(" - {0}", d);
     }
     return(true);
 }
コード例 #2
0
        public void DriveEnumeration()
        {
            using var pfs = new PhysFS("");
            var effectiveCdDrives = DriveInfo.GetDrives()
                                    .Where(x => x.DriveType == DriveType.CDRom)
                                    .Select(x => x.RootDirectory.FullName)
                                    .OrderBy(s => s)
                                    .ToArray();

            var enumeratedCdDrives = pfs.GetCdRomDirs().OrderBy(s => s);

            enumeratedCdDrives.Should().BeEquivalentTo(effectiveCdDrives);
        }
コード例 #3
0
        void DriveEnumeration()
        {
            using (var pfs = new PhysFS(""))
            {
                var effectiveCdDrives = DriveInfo.GetDrives()
                                        .Where(x => x.DriveType == DriveType.CDRom)
                                        .Select(x => x.RootDirectory.FullName)
                                        .ToArray();

                var enumeratedCdDrives = pfs.GetCdRomDirs();

                Array.Sort(effectiveCdDrives);
                Array.Sort(enumeratedCdDrives);

                Assert.Equal(effectiveCdDrives, enumeratedCdDrives);
            }
        }