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"))); }
public void TestGetInclusionProvider() { GameFs gameFs = new GameFs(ExternalPaths.GameInstallPath, null /* support for mods not present yet */); Drive.SiiFile.IInclusionProvider inclusionProvider = gameFs.GetIncludeProvider(); Assert.IsNotNull(inclusionProvider); Assert.IsInstanceOfType(inclusionProvider, typeof(GameFsIncludeProvider)); }
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)); } }
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")) { } }); }