public void DataDocumentFileTest()
        {
            using PortraitPackDataDocument document = PortraitPackDataDocument.Parse(_dataFile);

            Assert.AreEqual(Localization.KOKR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("AbathurToys18Portrait", out JsonElement _));
        }
        public void DataDocumentROMLocaleTest()
        {
            using PortraitPackDataDocument document = PortraitPackDataDocument.Parse(GetBytesForROM("AdmiralKrakenovPortrait"), Localization.FRFR);

            Assert.AreEqual(Localization.FRFR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("AdmiralKrakenovPortrait", out JsonElement _));
        }
        public void DataDocumentStreamTest()
        {
            using FileStream stream = new FileStream(_dataFile, FileMode.Open);
            using PortraitPackDataDocument document = PortraitPackDataDocument.Parse(stream, Localization.FRFR);

            Assert.AreEqual(Localization.FRFR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("AdmiralKrakenovPortrait", out JsonElement _));
        }
        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);
        }
        public async Task DataDocumentStreamWithGameStringStreamAsyncTest()
        {
            using FileStream streamGameString       = new FileStream(_jsonGameStringFileKOKR, FileMode.Open);
            using FileStream stream                 = new FileStream(_dataFile, FileMode.Open);
            using PortraitPackDataDocument document = await PortraitPackDataDocument.ParseAsync(stream, streamGameString);

            Assert.AreEqual(Localization.KOKR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("AdmiralKrakenovPortrait", out JsonElement _));
        }
示例#7
0
    public void DataDocumentStreamWithGSDTest()
    {
        using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileKOKR);
        using FileStream stream = new(_dataFile, FileMode.Open);
        using PortraitPackDataDocument document = PortraitPackDataDocument.Parse(stream, gameStringDocument);

        Assert.AreEqual(Localization.KOKR, document.Localization);
        Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("AdmiralKrakenovPortrait", out JsonElement _));
    }
示例#8
0
    public void UpdateGameStringPortraitPackTest()
    {
        using PortraitPackDataDocument dataDocument = _heroesDataDirectory.PortraitPackData(new HeroesDataVersion(2, 47, 3, 76124), true, Localization.KOKR);
        PortraitPack data = dataDocument.GetPortraitPackById("AbathurToys18Portrait");

        Assert.AreEqual("애벌레투르 초상화", data.Name);

        _heroesDataDirectory.UpdateGameString(data, new HeroesDataVersion(2, 48, 4, 77407), Localization.ENUS);
        Assert.AreEqual("portraitName", data.Name);
    }
示例#9
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));
        }
    }
 public PortraitPackDataDocumentTests()
 {
     _portraitPackDataDocument = PortraitPackDataDocument.Parse(LoadJsonTestData(), Localization.ENUS);
 }