using System.Reflection; using System.Security.Cryptography; using EvilEngine.Adapters.Tests.Support; using EvilEngine.Conversion; using EvilEngine.Formats; using EvilEngine.Mounts; namespace EvilEngine.Host.Tests; public sealed class AdapterFolderTests : IDisposable { private static readonly string Installed = typeof(AdapterFolderTests).Assembly .GetCustomAttributes() .Single(attribute => attribute.Key == "AdapterOutputRoot").Value!; private readonly string _extra = Path.Combine(Path.GetTempPath(), $"evil-adapters-{Guid.NewGuid():N}"); public void Dispose() { if (Directory.Exists(_extra)) Directory.Delete(_extra, true); } private static EngineHost Boot(params string[] roots) { var host = new EngineHost(); host.Adapters.LoadAll([Installed, .. roots]); return host; } private static MemorySource GarrysModInstall() { var install = new MemorySource("GarrysMod", CaseRule.Insensitive) .Add("garrysmod/gameinfo.txt", "\"GameInfo\" {}") .Add("garrysmod/steam.inf", "PatchVersion=2026.04.29\nProductName=garrysmod\nappID=4000\n") .Add("garrysmod/garrysmod.ver", "260917") .Add("garrysmod/addons/evil_fungus/lua/autorun/fungus.lua", "print('spores')") .Add("garrysmod/addons/evil_api/evil_api.gma", new GmaWriter().Add("lua/autorun/evil_api.lua", "EVIL = {}") .Add("models/props_c17/oildrum001.mdl", "IDST from the addon").Build("Evil API")) .Add("garrysmod/models/props_c17/oildrum001.mdl", "IDST") .Add("hl2_linux", ""); foreach (var (path, data) in new VpkWriter() .Add("models/props_c17/oildrum001.mdl", "IDST from the vpk", 0, 4) .Add("models/maxofs2d/cube_tool.mdl", "IDST cube", 1) .Add("scripts/propdata.txt", "inline") .Build("garrysmod/garrysmod_dir.vpk")) install.Add(path, data); return install; } [Fact] public void AnnouncesEachAdapterAsItLoads() { var host = new EngineHost(); var heard = new List(); host.Adapters.AdapterLoaded += adapter => heard.Add(adapter.Manifest.Id); host.Adapters.LoadAll([Installed]); Assert.Equal(host.Adapters.Loaded.Select(adapter => adapter.Manifest.Id), heard); } [Fact] public void LoadsOnlyTheAdaptersTheSwitchedOnGamesNeed() { var host = new EngineHost(); host.Adapters.LoadAll([Installed], FeatureFlags.Parse("[games]\ngmod = true\n", "features.toml")); Assert.Empty(host.Adapters.Problems); Assert.Equal(["gma", "gmod", "pc", "source", "steam", "vpk"], host.Adapters.Loaded.Select(adapter => adapter.Manifest.Id).Order(StringComparer.Ordinal)); Assert.Contains(host.Adapters.LeftOut, manifest => manifest.Id == "overgrowth"); Assert.Contains(host.Adapters.LeftOut, manifest => manifest.Id == "zip"); Assert.DoesNotContain(host.Adapters.LeftOut, manifest => manifest.Id == "vpk"); } [Fact] public void LoadsTheEnginesAdaptersInNeedsOrder() { var host = Boot(); Assert.Empty(host.Adapters.Problems); Assert.Equal( [ "addressables", "hpl3", "pc", "steam", "amnesia-bunker", "hpl2", "amnesia-dark-descent", "unity", "battlebit", "zip", "beamng", "ea.big", "dbpf", "ea.pegasus", "gma", "source", "vpk", "gmod", "pak", "goldsrc", "iso9660", "ksp", "left4dead2", "lethal-company", "oodle", "overgrowth", "portal2", "ps3", "quake", "unreal", "rocket-league", "satisfactory", "schedule-i", "scp-containment-breach", "skate3", "slime-rancher", "sourcegames", "subnautica", "the-sims-4", "unityfs" ], host.Adapters.Loaded.Select(adapter => adapter.Manifest.Id)); Assert.Equal( ["dbpf", "ea.big", "gma", "iso9660", "pak", "unityfs", "unreal.iostore", "unreal.pak", "vpk", "zip"], host.Mounts.Containers.Select(container => container.Id).Order()); Assert.Equal([ "amnesia-bunker", "amnesia-dark-descent", "amnesia-justine", "battlebit-remastered", "beamng-drive", "ep2", "episodic", "gmod", "half-life", "hl2", "ksp", "left4dead2", "lethal-company", "lostcoast", "overgrowth", "portal", "portal2", "quake", "quake-rerelease", "rocket-league", "satisfactory", "schedule-i", "scp-containment-breach", "skate3", "slime-rancher", "subnautica", "the-sims-4" ], host.Mounts.Games.Select(game => game.Game).Order()); Assert.Equal(["source.mdl", "source.bsp"], host.Conversion.Converters("gmod", ContentKind.Model).Select(converter => converter.Id)); } [Fact] public void TitlesEveryInstalledGameApart() { var host = Boot(); var titles = host.Adapters.Loaded.SelectMany(adapter => adapter.Manifest.Titles).ToArray(); Assert.Equal(host.Mounts.Games.Select(game => game.Game).Order(), titles.Select(pair => pair.Key).Order()); Assert.Equal(titles.Length, titles.Select(pair => pair.Value).Distinct(StringComparer.OrdinalIgnoreCase).Count()); Assert.Equal( ["Portal", "Half-Life 2", "Half-Life 2: Episode One", "Half-Life 2: Episode Two", "Half-Life 2: Lost Coast"], host.Adapters.Find("sourcegames")!.Manifest.Games.Select(host.Adapters.Find("sourcegames")!.Manifest.Title)); } [Fact] public void NotesAGameTitledAsAnotherAdaptersGame() { var folder = Path.Combine(_extra, "zz-gmod"); Directory.CreateDirectory(folder); File.WriteAllText(Path.Combine(folder, "adapter.toml"), "id = \"zz-gmod\"\nname = \"Another Garry's Mod\"\nversion = \"0.1.0\"\napi = 1\ncode = \"Code/zz-gmod.dll\"\ngames = [\"gmod2\"]\n[titles]\ngmod2 = \"garry's mod\"\n"); var host = Boot(_extra); Assert.Contains(host.Adapters.Problems, problem => problem.Subject == "zz-gmod" && problem.Reason == "titles gmod2 'garry's mod', as gmod titles gmod."); } [Fact] public void LoadsAdaptersFromARelativeRoot() { var host = new EngineHost(); host.Adapters.LoadAll([Path.GetRelativePath(Environment.CurrentDirectory, Installed)]); Assert.Empty(host.Adapters.Problems); Assert.Equal(Boot().Adapters.Loaded.Select(adapter => adapter.Manifest.Id), host.Adapters.Loaded.Select(adapter => adapter.Manifest.Id)); } [Fact] public void ProbesAndPlansGarrysMod() { var host = Boot(); var probe = Assert.Single(host.Mounts.Probe(GarrysModInstall(), "GarrysMod")); Assert.Equal(new MountId("gmod", "pc", "2026.04.29"), probe.Id); Assert.Equal(ProbeStatus.Known, probe.Probe.Status); Assert.Contains("hl2_linux is the linux player build", probe.Probe.Evidence); var mount = host.Mounts.Open(probe); Assert.Equal( [ "addons/evil_api", "addons/evil_fungus", "addons/evil_api/evil_api.gma", "garrysmod.vpk", "garrysmod", "sourceengine", "download" ], mount.Layers.Select(layer => layer.Name)); Assert.Equal("addons/evil_fungus", mount.Origin("lua/autorun/fungus.lua")!.Layer.Name); Assert.NotNull(mount.Part("content")); } [Fact] public void ReadsGarrysModThroughItsVpksAndGmas() { var host = Boot(); var mount = host.Mounts.Open(host.Mounts.Probe(GarrysModInstall(), "GarrysMod")[0]); Assert.Equal("EVIL = {}", mount.Files.ReadAllText("lua/autorun/evil_api.lua")); Assert.Equal("addons/evil_api/evil_api.gma", mount.Origin("lua/autorun/evil_api.lua")!.Layer.Name); Assert.Equal("IDST from the addon", mount.Files.ReadAllText("models/props_c17/oildrum001.mdl")); Assert.Equal("IDST cube", mount.Files.ReadAllText("models/maxofs2d/cube_tool.mdl")); Assert.Equal("garrysmod.vpk", mount.Origin("models/maxofs2d/cube_tool.mdl")!.Layer.Name); Assert.Equal("GarrysMod/garrysmod/garrysmod_dir.vpk", mount.Origin("scripts/propdata.txt")!.Location); Assert.Equal("IDST from the vpk", mount.Layers.Single(layer => layer.Name == "garrysmod.vpk").Files .ReadAllText("models/props_c17/oildrum001.mdl")); } [Fact] public void ConvertsGarrysModContentThroughTheSourceFamily() { var host = Boot(); var mount = host.Mounts.Open(host.Mounts.Probe(GarrysModInstall(), "GarrysMod")[0]); host.Conversion.AddNamespace(new ContentNamespace("gmod", new LayeredSource("gmod", CaseRule.Insensitive, [mount.Layers.Single(layer => layer.Name == "garrysmod")]))); var barrel = host.Conversion.Get(ContentKind.Model, ContentId.Parse("gmod:models/props_c17/oildrum001")); Assert.Equal(ConversionStatus.Failed, barrel.Status); Assert.Contains(barrel.Diagnostics, diagnostic => diagnostic.StartsWith("source.mdl failed on gmod:models/props_c17/oildrum001") && diagnostic.Contains("shorter than an MDL header")); Assert.Equal(ConversionStatus.NoConverter, host.Conversion.Get(ContentKind.Model, ContentId.Parse("gmod:models/missing")).Status); } [Fact] public void RefusesAnAdapterThatReachesTheEnginesOwnAssemblies() { var folder = Path.Combine(_extra, "rogue"); Directory.CreateDirectory(Path.Combine(folder, "Code")); File.Copy(typeof(AdapterFolderTests).Assembly.Location, Path.Combine(folder, "Code", "rogue.dll")); File.WriteAllText(Path.Combine(folder, "adapter.toml"), "id = \"rogue\"\nname = \"Rogue\"\nversion = \"1.0.0\"\napi = 1\ncode = \"Code/rogue.dll\"\n"); var host = new EngineHost(); var heard = new List(); host.Adapters.ProblemNoted += heard.Add; host.Adapters.LoadAll([Installed, _extra]); var problem = Assert.Single(host.Adapters.Problems); Assert.Same(problem, Assert.Single(heard)); Assert.Equal("rogue", problem.Subject); Assert.Contains("rogue.dll references EvilEngine.Host, which is the engine's own.", problem.Reason); } [Fact] public void RefusesAnAdapterWhoseNeedsArentInstalled() { var folder = Path.Combine(_extra, "skate2"); Directory.CreateDirectory(folder); File.WriteAllText(Path.Combine(folder, "adapter.toml"), "id = \"skate2\"\nname = \"Skate 2\"\nversion = \"0.1.0\"\napi = 1\ncode = \"Code/skate2.dll\"\ngames = [\"skate2\"]\n[titles]\nskate2 = \"Skate 2\"\n[needs]\n\"ea.ignite\" = \"^1\"\n"); var host = Boot(_extra); Assert.Contains(host.Adapters.Problems, problem => problem.Subject == "skate2" && problem.Reason == "needs adapter ea.ignite ^1, which isn't installed."); Assert.Equal(SatisfactionStatus.NoAdapter, host.Mounts.Satisfies(new MountRequirement("skate2")).Status); } [Fact] public void ReadsARealGarrysModInstall() { var path = Environment.GetEnvironmentVariable("EVIL_GMOD"); Assert.SkipWhen(path is null, "Set EVIL_GMOD to a Garry's Mod install to read it."); var host = Boot(); var probe = Assert.Single(host.Mounts.Probe(path!)); Assert.Equal("gmod", probe.Id.Game); Assert.Equal(ProbeStatus.Known, probe.Probe.Status); var mount = host.Mounts.Open(probe); var tree = mount.Files.EnumerateAll().Select(entry => entry.Path.Value) .ToHashSet(StringComparer.OrdinalIgnoreCase); foreach (var layer in mount.Layers) Assert.All(layer.Files.EnumerateAll(), entry => Assert.Contains(entry.Path.Value, tree)); Assert.True(host.Mounts.Satisfies(new MountRequirement("gmod") { Parts = ["content"], Platforms = ["pc"], Builds = [probe.Id.Build] }).IsSatisfied); Assert.Equal(SatisfactionStatus.NotMounted, host.Mounts.Satisfies(new MountRequirement("gmod") { Builds = ["2013.01.01"] }).Status); Assert.Equal(ExternalState.Resolved, mount.Externals["workshop"]!.State); var items = mount.Layers.Where(layer => layer.Name.StartsWith("workshop/", StringComparison.Ordinal)) .Select(layer => layer.Name).ToArray(); Assert.NotEmpty(items); Assert.All(items, item => Assert.NotNull(mount.Part(item))); var withoutFirst = Boot().Mounts; var without = withoutFirst.Open(withoutFirst.Probe(path!)[0], new Dictionary { [items[0]] = ExternalSetting.Disabled }); Assert.Equal(items[1..], without.Layers.Where(layer => layer.Name.StartsWith("workshop/", StringComparison.Ordinal)) .Select(layer => layer.Name)); var again = Boot().Mounts; var reopened = again.Open(again.Probe(path!)[0]); Assert.Equal(mount.Build, reopened.Build); Assert.Equal(mount.Part("content")!.Fingerprint, reopened.Part("content")!.Fingerprint); } [Theory] [InlineData("models/alyx.mdl", 480915, "028bb5d5569cab0aad8ccdd367ff5c38d5452e33bf0f6a4df9262c0ce2881844", "garrysmod.vpk")] [InlineData("models/maxofs2d/cube_tool.mdl", 6664, "8f3e842b0ca5045f507094f8b50161941b244ef532987b6dd067008b7dbb70ee", "garrysmod.vpk")] [InlineData("models/player.phy", 0, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "garrysmod.vpk")] [InlineData("materials/brick/brickwall001a.vtf", 174968, "ce3714eb72c9c3c03a40047a401ecdf965b0a7c4240571b623ea6fe7e3a9eee8", "sourceengine/hl2_textures.vpk")] [InlineData("sound/vo/breencast/br_welcome01.wav", 342299, "c1b045ad95d61fdcbfd8ca0d651ddb1d0dac6103e99315ffb429edeef5871e36", "sourceengine/hl2_sound_vo_english.vpk")] [InlineData("sound/ambient/wind/wind1.wav", 293566, "cb2cf64ba720211ec52d13243a25bdd12d7126c935955e2866b78e23c06c6b6a", "sourceengine/hl2_sound_misc.vpk")] [InlineData("models/props_c17/oildrum001.mdl", 1976, "baab025ebeea54f3977ede109c9903389e289bfc545e62ed2d978bfe11a4e325", "sourceengine/hl2_misc.vpk")] [InlineData("gameinfo.txt", 1197, "c616a6f675f69b6fe2d35d5950949a8379b49e4e26c6690ba40c3b33822a7df4", "garrysmod")] [InlineData("lua/wos/dynabase/registers/wos_legacy_registers.lua", 6956, "87f1280a79b72b2688d3e773357199819648a78a5512c17f2bc3406db7cd0c15", "workshop/2917050373")] [InlineData("materials/models/props_foliage/tree_deciduous_cards_01_darker.vmt", 236, "9ab398f4218fbd87a800275c3c73715ec801901637fb8d991feef5dda56098c8", "hl2/hl2/hl2_misc.vpk")] [InlineData("materials/models/ceilinggibs/ceiling1.vmt", 69, "347ebaccd4b3af2ef449a9c78c40d728892b982a830a963eab527cd9d9b1933f", "fallbacks.vpk")] public void ReadsARealGarrysModInstallByteForByte(string path, long length, string sha256, string layer) { var install = Environment.GetEnvironmentVariable("EVIL_GMOD"); Assert.SkipWhen(install is null, "Set EVIL_GMOD to a Garry's Mod install to read it."); var host = Boot(); var mount = host.Mounts.Open(Assert.Single(host.Mounts.Probe(install!))); var bytes = mount.Files.ReadAllBytes(path); Assert.Equal(length, bytes.Length); Assert.Equal(sha256, Convert.ToHexStringLower(SHA256.HashData(bytes))); Assert.Equal(layer, mount.Origin(path)!.Layer.Name); } [Theory] [InlineData("PS3_GAME/PARAM.SFO", 1040, "f4d897b2b4622eccf89eaa9742d11559db437f493577508793b30b702471422f", null)] [InlineData("data/content/characterVersion.txt", 8, "c09d53220616cb8e041092b417a8f5053dc71b07845ed0ab4b8770386d857b49", "USRDIR")] [InlineData("data/content/world/stream/DIST_StartPark/cPres_50_-50_high.psf", 256, "86121eb6cd52fc8a7a9ae3938e77b2e515b0ae4bf588d6c28cc06e310947a61e", "data/content/worldDIST_StartPark.big")] [InlineData("data/boundary/c_2a_02_jam_branded_pure.xml", 213, "1bfc3377008e3c9997ebe61c6c18317293a2d8f4cf9795abfc2970ee77ad5f68", "data/big/miscload.big")] [InlineData("data/anim/SkaterBodyPres.abin", 5824, "edd0733c84f84e8d0e242f4ded5e3a10b8caa9818a6dca3cc8dea38c4fb1a89c", "data/big/miscload.big")] [InlineData("data/db/challenge_local_data/freeskate_testdmo.vlt", 336, "17ef0b148e77e3c4ea397c6a8facf7c07c061475770fc36a976428506adf604a", "data/big/db.big")] [InlineData("data/scene/anim/Balcony_tower_061.abin", 29360, "2bf66e2556d6ec16626f4bd6387d039dd49de1dfacac9570bae428d8c3986219", "data/big/scene.big")] [InlineData("data/content/createacharacter/model/cas_db/OuterTorso/0x00000e8e03e38811.psg", 118092, "37beeb5e5ed1b64fc8d686d9bb7844450f7ef94687303dbecc122acde0d79ee3", "data/content/createacharacter.big")] public void ReadsARealSkate3Ps3ImageByteForByte(string path, long length, string sha256, string? layer) { var image = Environment.GetEnvironmentVariable("EVIL_SKATE3_PS3"); Assert.SkipWhen(image is null, "Set EVIL_SKATE3_PS3 to the Skate 3 PS3 disc image (BLUS30464) to read it."); var host = Boot(); var probe = Assert.Single(host.Mounts.Probe(image!)); var mount = host.Mounts.Open(probe); var files = layer is null ? probe.Probe.Tree : mount.Files; var bytes = files.ReadAllBytes(path); Assert.Equal(length, bytes.Length); Assert.Equal(sha256, Convert.ToHexStringLower(SHA256.HashData(bytes))); if (layer is not null) Assert.Equal(layer, mount.Origin(path)!.Layer.Name); } [Fact] public void MountsARealSkate3Ps3Image() { var image = Environment.GetEnvironmentVariable("EVIL_SKATE3_PS3"); Assert.SkipWhen(image is null, "Set EVIL_SKATE3_PS3 to the Skate 3 PS3 disc image (BLUS30464) to read it."); var host = Boot(); var probe = Assert.Single(host.Mounts.Probe(image!)); Assert.Equal(new MountId("skate3", "ps3", "BLUS30464-01.00"), probe.Id); Assert.Equal(ProbeStatus.Known, probe.Probe.Status); Assert.Equal(["iso9660"], probe.ContainerChain); var mount = host.Mounts.Open(probe); Assert.Equal(32, mount.Layers.Count); Assert.Equal(28046, mount.Files.EnumerateAll().Count()); Assert.True(host.Mounts.Satisfies(new MountRequirement("skate3") { Parts = ["gameplay", "character"] }) .IsSatisfied); Assert.Equal( [ "gameplay", "controls", "rig", "character", "skatepark", "world/blackboxpark", "world/downtown", "world/downtownskatepark", "world/industrial", "world/industrialskatepark", "world/maloofmoneycup", "world/megapark", "world/skateschool", "world/startpark", "world/university" ], mount.Parts.Select(part => part.Name)); Assert.All(mount.Parts.SelectMany(part => part.DefiningFiles), path => Assert.True(mount.Files.Exists(path), $"{path} is missing")); Assert.Equal(4, mount.Part("world/university")!.DefiningFiles.Count); var again = Boot().Mounts; var reopened = again.Open(again.Probe(image!)[0]); Assert.Equal(mount.Build, reopened.Build); Assert.Equal(mount.Part("gameplay")!.Fingerprint, reopened.Part("gameplay")!.Fingerprint); } [Fact] public void ReadsARealSatisfactoryInstallsKrakenBlocksThroughTheOodleAdapter() { var install = Environment.GetEnvironmentVariable("EVIL_SATISFACTORY"); Assert.SkipWhen(install is null, "Set EVIL_SATISFACTORY to a Satisfactory install to read it."); var host = Boot(); var mount = host.Mounts.Open(Assert.Single(host.Mounts.Probe(install!))); var plate = mount.Files.EnumerateAll().Single(entry => entry.Path.Name == "TX_IronPlate_Relf.ubulk").Path; foreach (var path in new[] { plate, "FactoryGame/Content/FactoryGame/Resource/Parts/IronPlate/UI/IconDesc_IronPlates_256.uasset" }) { var bytes = mount.Files.ReadAllBytes(path); var claim = mount.Parts.Select(part => part.Claims.GetValueOrDefault(path)).OfType().First(); Assert.Equal($"blake3:{Convert.ToHexStringLower(Blake3.Hash(bytes, 20))}", claim); } } [Fact] public void MountsARealKspInstall() { var install = Environment.GetEnvironmentVariable("EVIL_KSP"); Assert.SkipWhen(install is null, "Set EVIL_KSP to a Kerbal Space Program install to read it."); var host = Boot(); var probe = Assert.Single(host.Mounts.Probe(install!)); Assert.Equal(new MountId("ksp", "pc", "1.12.5.3190"), probe.Id); Assert.Equal(ProbeStatus.Known, probe.Probe.Status); var mount = host.Mounts.Open(probe); var items = mount.Layers.Where(layer => layer.Name.StartsWith("workshop/", StringComparison.Ordinal)) .Select(layer => layer.Name).ToArray(); Assert.Equal(6, items.Length); Assert.Equal(["GameData/Squad", .. items, "install"], mount.Layers.Select(layer => layer.Name)); Assert.Equal(probe.Probe.Tree.EnumerateAll().Count() + 12, mount.Files.EnumerateAll().Count()); Assert.Equal("GameData/Squad", mount.Origin("GameData/Squad/Parts/Aero/airbrake/Airbrake.cfg")!.Layer.Name); Assert.Equal(["parts", "interiors", .. items], mount.Parts.Select(part => part.Name)); Assert.All(items, item => Assert.NotNull(mount.Part(item)!.Version)); Assert.All(mount.Part("parts")!.DefiningFiles.Concat(mount.Part("interiors")!.DefiningFiles), path => Assert.True(mount.Files.Exists(path), $"{path} is missing")); Assert.All(items.SelectMany(item => mount.Part(item)!.DefiningFiles), path => Assert.True(mount.Externals["workshop"]!.Files!.Exists(path), $"{path} is missing")); Assert.True(host.Mounts.Satisfies(new MountRequirement("ksp") { Parts = ["parts"], Platforms = ["pc"] }) .IsSatisfied); Assert.Equal(SatisfactionStatus.NotMounted, host.Mounts.Satisfies(new MountRequirement("ksp") { Builds = ["1.12.3.3173"] }).Status); var again = Boot().Mounts; var reopened = again.Open(again.Probe(install!)[0]); Assert.Equal(mount.Build, reopened.Build); Assert.Equal(mount.Part("parts")!.Fingerprint, reopened.Part("parts")!.Fingerprint); } [Fact] public void MountsARealSubnauticaInstall() { var install = Environment.GetEnvironmentVariable("EVIL_SUBNAUTICA"); Assert.SkipWhen(install is null, "Set EVIL_SUBNAUTICA to a Subnautica install to read it."); var host = Boot(); var probe = Assert.Single(host.Mounts.Probe(install!)); Assert.Equal(new MountId("subnautica", "pc", "83031"), probe.Id); Assert.Equal(ProbeStatus.Known, probe.Probe.Status); var mount = host.Mounts.Open(probe); Assert.Equal(["install"], mount.Layers.Select(layer => layer.Name)); Assert.Equal(probe.Probe.Tree.EnumerateAll().Count(), mount.Files.EnumerateAll().Count()); Assert.Empty(mount.Notes); Assert.Equal(["gameplay", "vehicles", "creatures", "habitats", "terrain", "world"], mount.Parts.Select(part => part.Name)); Assert.Equal([42, 385, 453, 555, 5420, 15031], mount.Parts.Select(part => part.DefiningFiles.Count)); Assert.All(mount.Parts.SelectMany(part => part.DefiningFiles), path => Assert.True(mount.Files.Exists(path), $"{path} is missing")); Assert.True(host.Mounts.Satisfies(new MountRequirement("subnautica") { Parts = ["vehicles"], Platforms = ["pc"] }).IsSatisfied); Assert.Equal(SatisfactionStatus.NotMounted, host.Mounts.Satisfies(new MountRequirement("subnautica") { Builds = ["71288"] }).Status); var again = Boot().Mounts; var reopened = again.Open(again.Probe(install!)[0]); Assert.Equal(mount.Build, reopened.Build); Assert.Equal(mount.Part("vehicles")!.Fingerprint, reopened.Part("vehicles")!.Fingerprint); } }