public void FormLink_LoadOrder_ResolveAll_DoubleQuery(LinkCacheTestTypes cacheType)
        {
            var mod         = new SkyrimMod(TestConstants.PluginModKey, SkyrimRelease.SkyrimLE);
            var npc         = mod.Npcs.AddNew();
            var mod2        = new SkyrimMod(TestConstants.PluginModKey3, SkyrimRelease.SkyrimLE);
            var npcOverride = mod2.Npcs.GetOrAddAsOverride(npc);

            npcOverride.FaceParts = new NpcFaceParts();
            var loadOrder = new LoadOrder <ISkyrimModGetter>()
            {
                mod,
                new SkyrimMod(TestConstants.PluginModKey2, SkyrimRelease.SkyrimLE),
                mod2
            };

            var(style, package) = GetLinkCache(loadOrder, cacheType);
            var formLink = new FormLink <INpcGetter>(npc.FormKey);

            WrapPotentialThrow(cacheType, style, () =>
            {
                var resolved = formLink.ResolveAll(package).ToArray();
                resolved.Should().HaveCount(2);
                resolved.First().Should().BeSameAs(npcOverride);
                resolved.Last().Should().BeSameAs(npc);
            });
        }
        public void FormLink_LoadOrder_ResolveAll_Empty()
        {
            var package = TypicalLoadOrder().ToImmutableLinkCache();
            FormLink <INpcGetter> formLink = new FormLink <INpcGetter>(UnusedFormKey);

            formLink.ResolveAll(package).Should().BeEmpty();
        }
        public void FormLink_Direct_ResolveAll_Typed_Empty(LinkCacheTestTypes cacheType)
        {
            var formLink = new FormLink <IPlacedGetter>(UnusedFormKey);

            var(style, package) = GetLinkCache(new SkyrimMod(TestConstants.PluginModKey, SkyrimRelease.SkyrimLE), cacheType);
            formLink.ResolveAll <IPlacedGetter, IPlacedNpcGetter>(package).Should().BeEmpty();
        }
        public void FormLink_Direct_ResolveAll_Linked(LinkCacheTestTypes cacheType)
        {
            var mod = new SkyrimMod(TestConstants.PluginModKey, SkyrimRelease.SkyrimLE);
            var npc = mod.Npcs.AddNew();

            var(style, package) = GetLinkCache(mod, cacheType);
            FormLink <INpc> formLink = new FormLink <INpc>(npc.FormKey);

            WrapPotentialThrow(cacheType, style, () =>
            {
                var resolved = formLink.ResolveAll(package).ToArray();
                resolved.Should().HaveCount(1);
                resolved.First().Should().BeSameAs(npc);
            });
        }