Example #1
0
    public void TryGetUnitByIdTest(string?id, bool abilities, bool subAbilities)
    {
        if (id is null || id == "asdf")
        {
            Assert.IsFalse(_unitDataDocument.TryGetUnitById(id, out _, abilities, subAbilities));

            return;
        }

        Assert.IsTrue(_unitDataDocument.TryGetUnitById(id, out Unit? unit, abilities, subAbilities));
        BasicAbathurEvolvedMonstrosityAsserts(unit !);
    }
Example #2
0
    public void DataDocumentROMGSDTest()
    {
        using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileKOKR);
        using UnitDataDocument unitDataDocument     = UnitDataDocument.Parse(GetBytesForROM("AbathurEvolvedMonstrosity"), gameStringDocument);

        Assert.AreEqual(Localization.KOKR, unitDataDocument.Localization);
        Assert.IsTrue(unitDataDocument.TryGetUnitById("AbathurEvolvedMonstrosity", out Unit _, false, false));
    }
Example #3
0
    public void DataDocumentFileGSDTest()
    {
        using GameStringDocument gameStringDocument = GameStringDocument.Parse(_jsonGameStringFileFRFR);
        using UnitDataDocument unitDataDocument     = UnitDataDocument.Parse(_dataFile, gameStringDocument);

        Assert.AreEqual(Localization.FRFR, unitDataDocument.Localization);
        Assert.IsTrue(unitDataDocument.TryGetUnitById("AbathurEvolvedMonstrosity", out Unit _, false, false));
    }
Example #4
0
    public void UnitDataTest(int major, int minor, int revision, int build, bool isPtr, bool gamestrings, Localization localization)
    {
        UnitDataDocument dataDocument = _heroesDataDirectory.UnitData(new HeroesDataVersion(major, minor, revision, build, isPtr), gamestrings, localization);

        Assert.IsTrue(dataDocument.TryGetUnitById("AbathurEvolvedMonstrosity", out Unit? value, false, false));

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