예제 #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 !);
    }
예제 #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));
    }
예제 #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));
    }
예제 #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));
        }
    }