Example #1
0
        public void DataDocumentROMLocaleTest()
        {
            using BannerDataDocument document = BannerDataDocument.Parse(GetBytesForROM("BannerD3DemonHunter"), Localization.FRFR);

            Assert.AreEqual(Localization.FRFR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("BannerD3DemonHunter", out JsonElement _));
        }
Example #2
0
        public void DataDocumentFileTest()
        {
            using BannerDataDocument document = BannerDataDocument.Parse(_dataFile);

            Assert.AreEqual(Localization.KOKR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("BannerD3DemonHunter", out JsonElement _));
        }
Example #3
0
        public void DataDocumentStreamTest()
        {
            using FileStream stream           = new FileStream(_dataFile, FileMode.Open);
            using BannerDataDocument document = BannerDataDocument.Parse(stream, Localization.FRFR);

            Assert.AreEqual(Localization.FRFR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("BannerD3DemonHunter", out JsonElement _));
        }
Example #4
0
        public void DataDocumentROMGSDTest()
        {
            using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileKOKR);
            using BannerDataDocument document           = BannerDataDocument.Parse(GetBytesForROM("BannerD3DemonHunter"), gameStringDocument);

            Assert.AreEqual(Localization.KOKR, document.Localization);
            Assert.IsTrue(document.TryGetBannerById("BannerD3DemonHunter", out Banner _));
        }
Example #5
0
        public void DataDocumentFileGSDTest()
        {
            using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileFRFR);
            using BannerDataDocument document           = BannerDataDocument.Parse(_dataFile, gameStringDocument);

            Assert.AreEqual(Localization.FRFR, document.Localization);
            Assert.IsTrue(document.TryGetBannerById("BannerD3DemonHunter", out Banner _));
        }
Example #6
0
        public void DataDocumentStreamWithGSDTest()
        {
            using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileKOKR);
            using FileStream stream           = new FileStream(_dataFile, FileMode.Open);
            using BannerDataDocument document = BannerDataDocument.Parse(stream, gameStringDocument);

            Assert.AreEqual(Localization.KOKR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("BannerD3DemonHunter", out JsonElement _));
        }
Example #7
0
        public async Task DataDocumentStreamWithGameStringStreamAsyncTest()
        {
            using FileStream streamGameString = new FileStream(_jsonGameStringFileKOKR, FileMode.Open);
            using FileStream stream           = new FileStream(_dataFile, FileMode.Open);
            using BannerDataDocument document = await BannerDataDocument.ParseAsync(stream, streamGameString);

            Assert.AreEqual(Localization.KOKR, document.Localization);
            Assert.IsTrue(document.JsonDataDocument.RootElement.TryGetProperty("BannerD3DemonHunter", out JsonElement _));
        }
Example #8
0
    public void UpdateGameStringBannerTest()
    {
        using BannerDataDocument dataDocument = _heroesDataDirectory.BannerData(new HeroesDataVersion(2, 47, 3, 76124), true, Localization.KOKR);
        Banner data = dataDocument.GetBannerById("BannerD3DemonHunter");

        Assert.AreEqual("악마사냥꾼 깃발", data.Name);

        _heroesDataDirectory.UpdateGameString(data, new HeroesDataVersion(2, 48, 4, 77407), Localization.ENUS);
        Assert.AreEqual("bannerName", data.Name);
    }
Example #9
0
    public void BannerDataTest(int major, int minor, int revision, int build, bool isPtr, bool gamestrings, Localization localization)
    {
        BannerDataDocument dataDocument = _heroesDataDirectory.BannerData(new HeroesDataVersion(major, minor, revision, build, isPtr), gamestrings, localization);

        Assert.IsTrue(dataDocument.TryGetBannerById("BannerD3DemonHunter", out Banner? value));

        if (gamestrings)
        {
            Assert.IsTrue(!string.IsNullOrEmpty(value !.Name));
        }
        else
        {
            Assert.IsFalse(!string.IsNullOrEmpty(value !.Name));
        }
    }
Example #10
0
 public BannerDataDocumentTests()
 {
     _bannerDataDocument = BannerDataDocument.Parse(LoadJsonTestData(), Localization.ENUS);
 }