public void NatureEnumListTest()
    {
        PKMN.NatureEnumList natureEnumList = new PKMN.NatureEnumList();
        natureEnumList.Add(PKMN.Nature.HARDY);
        natureEnumList.Add(PKMN.Nature.QUIRKY);
        natureEnumList.Add(PKMN.Nature.LONELY);
        natureEnumList.Add(PKMN.Nature.BASHFUL);
        natureEnumList.Add(PKMN.Nature.QUIET);

        PKMN.NatureEnumList natureEnumListSame = new PKMN.NatureEnumList();
        natureEnumListSame.Add(PKMN.Nature.HARDY);
        natureEnumListSame.Add(PKMN.Nature.QUIRKY);
        natureEnumListSame.Add(PKMN.Nature.LONELY);
        natureEnumListSame.Add(PKMN.Nature.BASHFUL);
        natureEnumListSame.Add(PKMN.Nature.QUIET);

        PKMN.NatureEnumList natureEnumListReversed = new PKMN.NatureEnumList();
        natureEnumListReversed.Add(PKMN.Nature.QUIET);
        natureEnumListReversed.Add(PKMN.Nature.BASHFUL);
        natureEnumListReversed.Add(PKMN.Nature.LONELY);
        natureEnumListReversed.Add(PKMN.Nature.QUIRKY);
        natureEnumListReversed.Add(PKMN.Nature.HARDY);

        Assert.AreEqual(natureEnumList, natureEnumList);
        Assert.AreEqual(natureEnumList, natureEnumListSame);
        Assert.AreEqual(natureEnumList.GetHashCode(), natureEnumListSame.GetHashCode());

        Assert.AreNotEqual(natureEnumList, natureEnumListReversed);
        Assert.AreNotEqual(natureEnumList.GetHashCode(), natureEnumListReversed.GetHashCode());
    }
Exemple #2
0
    public void NatureListTest()
    {
        PKMN.NatureEnumList natureList = PKMN.Database.Lists.NatureList();
        Assert.AreEqual(natureList.Count, 25);
        Assert.AreEqual(natureList[0], PKMN.Nature.HARDY);
        Assert.AreEqual(natureList[24], PKMN.Nature.QUIRKY);

        PKMN.StringList natureNameList = PKMN.Database.Lists.NatureNameList();
        Assert.AreEqual(natureNameList.Count, 25);
        Assert.AreEqual(natureNameList[0], "Hardy");
        Assert.AreEqual(natureNameList[24], "Quirky");

        // Make sure lists match.
        Assert.AreEqual(natureList.Count, natureNameList.Count);
        for (int natureIndex = 0; natureIndex < natureList.Count; ++natureIndex)
        {
            string natureName = PKMN.PKMN.NatureToString(natureList[natureIndex]);
            Assert.AreEqual(natureName, natureNameList[natureIndex]);
        }
    }