public void TryGetPortraitPackByIdTest(string?id)
        {
            if (id is null || id == "asdf")
            {
                Assert.IsFalse(_portraitPackDataDocument.TryGetPortraitPackById(id, out _));

                return;
            }

            Assert.IsTrue(_portraitPackDataDocument.TryGetPortraitPackById(id, out PortraitPack? _));
            if (_portraitPackDataDocument.TryGetPortraitPackById(id, out PortraitPack? portraitPack))
            {
                BasicAdmiralKrakenovPortraitAsserts(portraitPack);
            }
        }
        public void DataDocumentROMGSDTest()
        {
            using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileKOKR);
            using PortraitPackDataDocument document     = PortraitPackDataDocument.Parse(GetBytesForROM("AdmiralKrakenovPortrait"), gameStringDocument);

            Assert.AreEqual(Localization.KOKR, document.Localization);
            Assert.IsTrue(document.TryGetPortraitPackById("AdmiralKrakenovPortrait", out PortraitPack? portraitPack));
            Assert.AreEqual("크라케노프 제독 초상화", portraitPack !.Name);
        }
        public void DataDocumentFileGSDTest()
        {
            using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileFRFR);
            using PortraitPackDataDocument document     = PortraitPackDataDocument.Parse(_dataFile, gameStringDocument);

            Assert.AreEqual(Localization.FRFR, document.Localization);
            Assert.IsTrue(document.TryGetPortraitPackById("AbathurToys18Portrait", out PortraitPack? portraitPack));
            Assert.AreEqual("애벌레투르 초상화", portraitPack !.Name);
        }
Пример #4
0
    public void PortraitPackDataTest(int major, int minor, int revision, int build, bool isPtr, bool gamestrings, Localization localization)
    {
        PortraitPackDataDocument dataDocument = _heroesDataDirectory.PortraitPackData(new HeroesDataVersion(major, minor, revision, build, isPtr), gamestrings, localization);

        Assert.IsTrue(dataDocument.TryGetPortraitPackById("AbathurToys18Portrait", out PortraitPack? value));

        if (gamestrings)
        {
            Assert.IsTrue(!string.IsNullOrEmpty(value !.Name));
        }
        else
        {
            Assert.IsFalse(!string.IsNullOrEmpty(value !.Name));
        }
    }