Exemplo n.º 1
0
        public void TestListFolder()
        {
            GameFs gameFs = new GameFs(ExternalPaths.GameInstallPath, null /* support for mods not present yet */);

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

            foreach (string n in new string[] { "map", "model", "prefab", "model2", "def", "video" })
            {
                Assert.IsTrue(names.Contains(n));
            }
        }
Exemplo n.º 2
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")) { }
            });
        }