예제 #1
0
        public void TestOpenFile()
        {
            GameFs gameFs = new GameFs(ExternalPaths.GameInstallPath, null /* support for mods not present yet */);

            Task.WaitAll(gameFs.Initialize());
            IEnumerable <string> names = gameFs.ListFolder("").Result;

            using (Stream s = gameFs.OpenFile("autoexec.cfg")) { }

            Assert.ThrowsException <FileNotFoundException>(delegate {
                using (Stream s2 = gameFs.OpenFile("not.existing.file.y48wvhwvcuhiunciu")) { }
            });
        }
        public void TestInclusion()
        {
            GameFs gameFs = new GameFs(ExternalPaths.GameInstallPath, null);

            Task.WaitAll(gameFs.Initialize());
            SiiFileReader reader = new SiiFileReader(gameFs.GetIncludeProvider("def"));

            Task.WaitAll(reader.ReadSiiFile(gameFs.OpenFile("def/country.sii")));
        }