Ejemplo n.º 1
0
        public static void BattleCDPocketTest(
            PKMN.ItemList battleCDPocket,
            PKMN.Game game
            )
        {
            int expectedLength = 60;

            // Check unchanging and initial values.
            Assert.AreEqual(battleCDPocket.Name, "Battle CDs");
            Assert.AreEqual(battleCDPocket.Game, game);
            Assert.AreEqual(battleCDPocket.Length, expectedLength);
            Assert.AreEqual(battleCDPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(battleCDPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                battleCDPocket,
                PKMN.Item.BATTLE_CD_01
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                battleCDPocket,
                new PKMN.Item[]
            {
                PKMN.Item.GONZAPS_KEY,
                PKMN.Item.POTION,
                PKMN.Item.MASTER_BALL,
                PKMN.Item.TM01,
                PKMN.Item.JOY_SCENT,
                PKMN.Item.ORAN_BERRY,
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.BATTLE_CD_01,
                PKMN.Item.BATTLE_CD_02,
                PKMN.Item.BATTLE_CD_03,
                PKMN.Item.BATTLE_CD_04,
                PKMN.Item.BATTLE_CD_05,
                PKMN.Item.BATTLE_CD_06,
                PKMN.Item.BATTLE_CD_07,
                PKMN.Item.BATTLE_CD_08
            };
            ItemsTestsCommon.TestItemListSettingItems(
                battleCDPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                battleCDPocket,
                validItems
                );

            Assert.AreEqual(battleCDPocket.ValidItems.Count, battleCDPocket.ValidItemNames.Count);
            Assert.AreEqual(battleCDPocket.ValidItems.Count, 60);
        }
Ejemplo n.º 2
0
        public static void ItemPCTest(
            PKMN.ItemList itemPC,
            PKMN.Game game
            )
        {
            // Check unchanging and initial values.
            Assert.AreEqual(itemPC.Name, "PC");
            Assert.AreEqual(itemPC.Game, game);
            Assert.AreEqual(itemPC.Length, 50);
            Assert.AreEqual(itemPC.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(itemPC);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                itemPC,
                PKMN.Item.POTION
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPC,
                WrongGenerationAllPocketItems
                );

            // Crystal-specific items.
            if (game == PKMN.Game.CRYSTAL)
            {
                foreach (PKMN.Item crystalItem in CrystalItems)
                {
                    itemPC.Add(crystalItem, 1);
                    itemPC.Remove(crystalItem, 1);
                }

                Assert.AreEqual(itemPC.NumItems, 0);
            }
            else
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    itemPC,
                    CrystalItems
                    );
            }

            // Start adding and removing stuff, and make sure the numbers are accurate.
            ItemsTestsCommon.TestItemListSettingItems(
                itemPC,
                AllPocketItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                itemPC,
                AllPocketItems
                );

            PKMN.ItemEnumList fullItemList = PKMN.Database.Lists.ItemList(game);

            Assert.AreEqual(itemPC.ValidItems.Count, itemPC.ValidItemNames.Count);
            Assert.AreEqual(itemPC.ValidItems.Count, fullItemList.Count);
        }
Ejemplo n.º 3
0
        public static void ItemListCommon(
            PKMN.ItemList itemList,
            PKMN.Game game
            )
        {
            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(itemList);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                itemList,
                PKMN.Item.POTION
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemList,
                WrongGenerationItems
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            ItemsTestsCommon.TestItemListSettingItems(
                itemList,
                Items
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                itemList,
                Items
                );

            PKMN.ItemEnumList fullItemList = PKMN.Database.Lists.ItemList(game);

            Assert.AreEqual(itemList.ValidItems.Count, itemList.ValidItemNames.Count);
            Assert.AreEqual(itemList.ValidItems.Count, fullItemList.Count);
        }
Ejemplo n.º 4
0
        public static void ItemPCTest(
            PKMN.ItemList itemPC,
            PKMN.Game game
            )
        {
            // Check unchanging and initial values.
            Assert.AreEqual(itemPC.Name, "PC");
            Assert.AreEqual(itemPC.Game, game);
            Assert.AreEqual(itemPC.Length, 50);
            Assert.AreEqual(itemPC.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(itemPC);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                itemPC,
                PKMN.Item.POTION
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPC,
                WrongGameAllPocketItems
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            ItemsTestsCommon.TestItemListSettingItems(
                itemPC,
                AllPocketItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                itemPC,
                AllPocketItems
                );

            Assert.AreEqual(itemPC.ValidItems.Count, itemPC.ValidItemNames.Count);

            PKMN.ItemEnumList fullItemList     = PKMN.Database.Lists.ItemList(game);
            PKMN.StringList   fullItemNameList = PKMN.Database.Lists.ItemNameList(game);
            Assert.AreEqual(fullItemList.Count, fullItemNameList.Count);

            if ((game == PKMN.Game.FIRERED) || (game == PKMN.Game.LEAFGREEN))
            {
                Assert.AreEqual(itemPC.ValidItems.Count, fullItemList.Count - 2);

                Assert.IsFalse(itemPC.ValidItems.Contains(PKMN.Item.BERRY_POUCH));
                Assert.IsFalse(itemPC.ValidItems.Contains(PKMN.Item.TM_CASE));

                Assert.IsFalse(itemPC.ValidItemNames.Contains("Berry Pouch"));
                Assert.IsFalse(itemPC.ValidItemNames.Contains("TM Case"));
            }
            else
            {
                Assert.AreEqual(itemPC.ValidItems.Count, fullItemList.Count);
            }
        }
Ejemplo n.º 5
0
        public static void ItemPCTest(
            PKMN.ItemList itemPC,
            PKMN.Game game
            )
        {
            bool colosseum = (game == PKMN.Game.COLOSSEUM);

            // Check unchanging and initial values.
            Assert.AreEqual(itemPC.Name, "PC");
            Assert.AreEqual(itemPC.Game, game);
            Assert.AreEqual(itemPC.Length, 235);
            Assert.AreEqual(itemPC.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(itemPC);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                itemPC,
                PKMN.Item.POTION
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPC,
                colosseum ? ColosseumWrongGameAllPocketItems : XDWrongGameAllPocketItems
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            ItemsTestsCommon.TestItemListSettingItems(
                itemPC,
                colosseum ? ColosseumAllPocketItems : XDAllPocketItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                itemPC,
                colosseum ? ColosseumAllPocketItems : XDAllPocketItems
                );

            PKMN.ItemEnumList fullItemList     = PKMN.Database.Lists.ItemList(game);
            PKMN.StringList   fullItemNameList = PKMN.Database.Lists.ItemNameList(game);

            Assert.AreEqual(itemPC.ValidItems.Count, itemPC.ValidItemNames.Count);
            Assert.AreEqual(itemPC.ValidItems.Count, fullItemList.Count);
            Assert.AreEqual(itemPC.ValidItemNames.Count, fullItemNameList.Count);
        }
Ejemplo n.º 6
0
        public static void BallPocketTest(
            PKMN.ItemList ballPocket,
            PKMN.Game game
            )
        {
            // Check unchanging and initial values.
            Assert.AreEqual(ballPocket.Name, "Balls");
            Assert.AreEqual(ballPocket.Game, game);
            Assert.AreEqual(ballPocket.Length, 12);
            Assert.AreEqual(ballPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(ballPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                ballPocket,
                PKMN.Item.MASTER_BALL
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                ballPocket,
                new PKMN.Item[]
            {
                PKMN.Item.POTION,
                PKMN.Item.BICYCLE,
                PKMN.Item.HM01
            }
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                ballPocket,
                new PKMN.Item[]
            {
                PKMN.Item.PREMIER_BALL,
                PKMN.Item.HEAL_BALL,
                PKMN.Item.DREAM_BALL
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.GREAT_BALL,
                PKMN.Item.POKE_BALL,
                PKMN.Item.PARK_BALL,
                PKMN.Item.FAST_BALL,
                PKMN.Item.MASTER_BALL,
                PKMN.Item.FRIEND_BALL,
                PKMN.Item.LOVE_BALL,
                PKMN.Item.LEVEL_BALL
            };
            ItemsTestsCommon.TestItemListSettingItems(
                ballPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                ballPocket,
                validItems
                );

            Assert.AreEqual(ballPocket.ValidItems.Count, ballPocket.ValidItemNames.Count);
            Assert.Greater(ballPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 7
0
        public static void BerryPocketTest(
            PKMN.ItemList berryPocket,
            PKMN.Game game
            )
        {
            int    expectedLength = 0;
            string expectedName   = "";

            if ((game == PKMN.Game.FIRERED) || (game == PKMN.Game.LEAFGREEN))
            {
                expectedLength = 43;
                expectedName   = "Berry Pouch";
            }
            else
            {
                expectedLength = 46;
                expectedName   = "Berries";
            }

            // Check unchanging and initial values.
            Assert.AreEqual(berryPocket.Name, expectedName);
            Assert.AreEqual(berryPocket.Game, game);
            Assert.AreEqual(berryPocket.Length, expectedLength);
            Assert.AreEqual(berryPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(berryPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                berryPocket,
                PKMN.Item.RAZZ_BERRY
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                berryPocket,
                new PKMN.Item[]
            {
                PKMN.Item.POTION,
                PKMN.Item.BICYCLE,
                PKMN.Item.GREAT_BALL,
                PKMN.Item.HM02
            }
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                berryPocket,
                new PKMN.Item[]
            {
                PKMN.Item.BERRY,
                PKMN.Item.OCCA_BERRY,
                PKMN.Item.ROSELI_BERRY
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.CHERI_BERRY,
                PKMN.Item.RAZZ_BERRY,
                PKMN.Item.LUM_BERRY,
                PKMN.Item.PINAP_BERRY,
                PKMN.Item.ASPEAR_BERRY,
                PKMN.Item.IAPAPA_BERRY,
                PKMN.Item.WIKI_BERRY,
                PKMN.Item.APICOT_BERRY
            };
            ItemsTestsCommon.TestItemListSettingItems(
                berryPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                berryPocket,
                validItems
                );

            Assert.AreEqual(berryPocket.ValidItems.Count, berryPocket.ValidItemNames.Count);
            Assert.Greater(berryPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 8
0
        public static void ItemPocketTest(
            PKMN.ItemList itemPocket,
            PKMN.Game game
            )
        {
            int expectedLength = 0;

            if ((game == PKMN.Game.RUBY) || (game == PKMN.Game.SAPPHIRE))
            {
                expectedLength = 20;
            }
            else if (game == PKMN.Game.EMERALD)
            {
                expectedLength = 30;
            }
            else
            {
                expectedLength = 42;
            }

            // Check unchanging and initial values.
            Assert.AreEqual(itemPocket.Name, "Items");
            Assert.AreEqual(itemPocket.Game, game);
            Assert.AreEqual(itemPocket.Length, expectedLength);
            Assert.AreEqual(itemPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(itemPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                itemPocket,
                PKMN.Item.POTION
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.BICYCLE,
                PKMN.Item.MASTER_BALL,
                PKMN.Item.HM01,
                PKMN.Item.RAZZ_BERRY
            }
                );

            // Confirm items from other generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.PINK_BOW,
                PKMN.Item.BLACK_SLUDGE,
                PKMN.Item.BINDING_BAND,
                PKMN.Item.BEEDRILLITE
            }
                );

            // Make sure we can't add items from Gamecube games.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.TIME_FLUTE,
                PKMN.Item.POKE_SNACK
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.POTION,
                PKMN.Item.ORANGE_MAIL,
                PKMN.Item.LAVA_COOKIE,
                PKMN.Item.STARDUST,
                PKMN.Item.SHADOW_MAIL,
                PKMN.Item.PINK_SCARF,
                PKMN.Item.ANTIDOTE,
                PKMN.Item.GREEN_SHARD
            };
            ItemsTestsCommon.TestItemListSettingItems(
                itemPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                itemPocket,
                validItems
                );

            Assert.AreEqual(itemPocket.ValidItems.Count, itemPocket.ValidItemNames.Count);
            Assert.Greater(itemPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 9
0
        public static void TMHMPocketTest(
            PKMN.ItemList tmhmPocket,
            PKMN.Game game
            )
        {
            int    expectedLength = 0;
            string expectedName   = "";

            if ((game == PKMN.Game.FIRERED) || (game == PKMN.Game.LEAFGREEN))
            {
                expectedLength = 58;
                expectedName   = "TM Case";
            }
            else
            {
                expectedLength = 64;
                expectedName   = "TMs & HMs";
            }

            // Check unchanging and initial values.
            Assert.AreEqual(tmhmPocket.Name, expectedName);
            Assert.AreEqual(tmhmPocket.Game, game);
            Assert.AreEqual(tmhmPocket.Length, expectedLength);
            Assert.AreEqual(tmhmPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(tmhmPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                tmhmPocket,
                PKMN.Item.TM01
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                tmhmPocket,
                new PKMN.Item[]
            {
                PKMN.Item.POTION,
                PKMN.Item.BICYCLE,
                PKMN.Item.GREAT_BALL,
                PKMN.Item.RAZZ_BERRY
            }
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                tmhmPocket,
                new PKMN.Item[]
            {
                PKMN.Item.TM51
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.TM01,
                PKMN.Item.HM01,
                PKMN.Item.TM02,
                PKMN.Item.HM02,
                PKMN.Item.TM03,
                PKMN.Item.HM03,
                PKMN.Item.TM04,
                PKMN.Item.HM04
            };
            ItemsTestsCommon.TestItemListSettingItems(
                tmhmPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                tmhmPocket,
                validItems
                );

            Assert.AreEqual(tmhmPocket.ValidItems.Count, tmhmPocket.ValidItemNames.Count);
            Assert.Greater(tmhmPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 10
0
        public static void BallPocketTest(
            PKMN.ItemList ballPocket,
            PKMN.Game game
            )
        {
            int expectedLength = 0;

            if ((game == PKMN.Game.FIRERED) || (game == PKMN.Game.LEAFGREEN))
            {
                expectedLength = 13;
            }
            else
            {
                expectedLength = 16;
            }

            // Check unchanging and initial values.
            Assert.AreEqual(ballPocket.Name, "Poké Balls");
            Assert.AreEqual(ballPocket.Game, game);
            Assert.AreEqual(ballPocket.Length, expectedLength);
            Assert.AreEqual(ballPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(ballPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                ballPocket,
                PKMN.Item.MASTER_BALL
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                ballPocket,
                new PKMN.Item[]
            {
                PKMN.Item.POTION,
                PKMN.Item.BICYCLE,
                PKMN.Item.HM01,
                PKMN.Item.RAZZ_BERRY
            }
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                ballPocket,
                new PKMN.Item[]
            {
                PKMN.Item.MOON_BALL,
                PKMN.Item.HEAL_BALL,
                PKMN.Item.DREAM_BALL
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.MASTER_BALL,
                PKMN.Item.ULTRA_BALL,
                PKMN.Item.GREAT_BALL,
                PKMN.Item.POKE_BALL,
                PKMN.Item.SAFARI_BALL,
                PKMN.Item.NET_BALL,
                PKMN.Item.DIVE_BALL,
                PKMN.Item.NEST_BALL
            };
            ItemsTestsCommon.TestItemListSettingItems(
                ballPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                ballPocket,
                validItems
                );

            Assert.AreEqual(ballPocket.ValidItems.Count, ballPocket.ValidItemNames.Count);
            Assert.Greater(ballPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 11
0
        public static void KeyItemPocketTest(
            PKMN.ItemList keyItemPocket,
            PKMN.Game game
            )
        {
            int expectedLength = 0;

            if ((game == PKMN.Game.RUBY) || (game == PKMN.Game.SAPPHIRE))
            {
                expectedLength = 20;
            }
            else
            {
                expectedLength = 30;
            }

            // Check unchanging and initial values.
            Assert.AreEqual(keyItemPocket.Name, "Key Items");
            Assert.AreEqual(keyItemPocket.Game, game);
            Assert.AreEqual(keyItemPocket.Length, expectedLength);
            Assert.AreEqual(keyItemPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(keyItemPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                keyItemPocket,
                PKMN.Item.BASEMENT_KEY
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                keyItemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.POTION,
                PKMN.Item.MASTER_BALL,
                PKMN.Item.HM01,
                PKMN.Item.RAZZ_BERRY
            }
                );

            // Confirm items from other generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                keyItemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.GS_BALL,
                PKMN.Item.POFFIN_CASE,
                PKMN.Item.DNA_SPLICERS,
                PKMN.Item.AQUA_SUIT
            }
                );

            // Confirm items from incompatible Generation III games can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                keyItemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.EIN_FILE_S,
                PKMN.Item.POWERUP_PART,
                PKMN.Item.GONZAPS_KEY,
                PKMN.Item.KRANE_MEMO_1
            }
                );
            if ((game == PKMN.Game.RUBY) || (game == PKMN.Game.SAPPHIRE))
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.HELIX_FOSSIL,
                    PKMN.Item.TEA,
                    PKMN.Item.RUBY
                }
                    );
            }
            if (game != PKMN.Game.EMERALD)
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.MAGMA_EMBLEM,
                    PKMN.Item.OLD_SEA_MAP
                }
                    );
            }

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.WAILMER_PAIL,
                PKMN.Item.BASEMENT_KEY,
                PKMN.Item.METEORITE,
                PKMN.Item.OLD_ROD,
                PKMN.Item.RED_ORB,
                PKMN.Item.ROOT_FOSSIL,
                PKMN.Item.CONTEST_PASS,
                PKMN.Item.EON_TICKET
            };
            ItemsTestsCommon.TestItemListSettingItems(
                keyItemPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                keyItemPocket,
                validItems
                );

            Assert.AreEqual(keyItemPocket.ValidItems.Count, keyItemPocket.ValidItemNames.Count);
            Assert.Greater(keyItemPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 12
0
        public static void ItemPocketTest(
            PKMN.ItemList itemPocket,
            PKMN.Game game
            )
        {
            // Check unchanging and initial values.
            Assert.AreEqual(itemPocket.Name, "Items");
            Assert.AreEqual(itemPocket.Game, game);
            Assert.AreEqual(itemPocket.Length, 20);
            Assert.AreEqual(itemPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(itemPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                itemPocket,
                PKMN.Item.POTION
                );

            // Confirm items from other pockets can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.BICYCLE,
                PKMN.Item.MASTER_BALL,
                PKMN.Item.HM01
            }
                );

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.BLACK_FLUTE,
                PKMN.Item.BLACK_SLUDGE,
                PKMN.Item.BINDING_BAND,
                PKMN.Item.BEEDRILLITE
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.POTION,
                PKMN.Item.HP_UP,
                PKMN.Item.WHITE_APRICORN,
                PKMN.Item.LUCKY_EGG,
                PKMN.Item.FLOWER_MAIL,
                PKMN.Item.BURN_HEAL,
                PKMN.Item.PSNCUREBERRY,
                PKMN.Item.STICK
            };
            ItemsTestsCommon.TestItemListSettingItems(
                itemPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                itemPocket,
                validItems
                );

            Assert.AreEqual(itemPocket.ValidItems.Count, itemPocket.ValidItemNames.Count);
            Assert.Greater(itemPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 13
0
        public static void BallPocketTest(
            PKMN.ItemList ballPocket,
            PKMN.Game game
            )
        {
            bool colosseum      = (game == PKMN.Game.COLOSSEUM);
            int  expectedLength = 16;

            // Check unchanging and initial values.
            Assert.AreEqual(ballPocket.Name, "Poké Balls");
            Assert.AreEqual(ballPocket.Game, game);
            Assert.AreEqual(ballPocket.Length, expectedLength);
            Assert.AreEqual(ballPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(ballPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                ballPocket,
                PKMN.Item.MASTER_BALL
                );

            // Confirm items from other pockets can't be added.
            if (colosseum)
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    ballPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.EIN_FILE_S,
                    PKMN.Item.POTION,
                    PKMN.Item.TM01,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.JOY_SCENT
                }
                    );
            }
            else
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    ballPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.GONZAPS_KEY,
                    PKMN.Item.POTION,
                    PKMN.Item.TM01,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.JOY_SCENT,
                    PKMN.Item.BATTLE_CD_01
                }
                    );
            }

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                ballPocket,
                new PKMN.Item[]
            {
                PKMN.Item.MOON_BALL,
                PKMN.Item.HEAL_BALL,
                PKMN.Item.DREAM_BALL
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.MASTER_BALL,
                PKMN.Item.ULTRA_BALL,
                PKMN.Item.GREAT_BALL,
                PKMN.Item.POKE_BALL,
                PKMN.Item.SAFARI_BALL,
                PKMN.Item.NET_BALL,
                PKMN.Item.DIVE_BALL,
                PKMN.Item.NEST_BALL
            };
            ItemsTestsCommon.TestItemListSettingItems(
                ballPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                ballPocket,
                validItems
                );

            Assert.AreEqual(ballPocket.ValidItems.Count, ballPocket.ValidItemNames.Count);
            Assert.Greater(ballPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 14
0
        public static void KeyItemPocketTest(
            PKMN.ItemList keyItemPocket,
            PKMN.Game game
            )
        {
            bool colosseum = (game == PKMN.Game.COLOSSEUM);

            PKMN.Item keyItem        = colosseum ? PKMN.Item.EIN_FILE_S : PKMN.Item.GONZAPS_KEY;
            int       expectedLength = 43;

            // Check unchanging and initial values.
            Assert.AreEqual(keyItemPocket.Name, "Key Items");
            Assert.AreEqual(keyItemPocket.Game, game);
            Assert.AreEqual(keyItemPocket.Length, expectedLength);
            Assert.AreEqual(keyItemPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(keyItemPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                keyItemPocket,
                keyItem
                );

            // Confirm items from other pockets can't be added.
            if (colosseum)
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.POTION,
                    PKMN.Item.GREAT_BALL,
                    PKMN.Item.TM01,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.JOY_SCENT
                }
                    );
            }
            else
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.POTION,
                    PKMN.Item.GREAT_BALL,
                    PKMN.Item.TM01,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.JOY_SCENT,
                    PKMN.Item.BATTLE_CD_01
                }
                    );
            }

            // Confirm items from other generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                keyItemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.GS_BALL,
                PKMN.Item.POFFIN_CASE,
                PKMN.Item.DNA_SPLICERS,
                PKMN.Item.AQUA_SUIT
            }
                );

            // Confirm items from incompatible Generation III games can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                keyItemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.HELIX_FOSSIL,
                PKMN.Item.TEA,
                PKMN.Item.RUBY
            }
                );
            ItemsTestsCommon.TestItemListInvalidItems(
                keyItemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.MAGMA_EMBLEM,
                PKMN.Item.OLD_SEA_MAP
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            if (colosseum)
            {
                ItemsTestsCommon.TestItemListSettingItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.JAIL_KEY,
                    PKMN.Item.ELEVATOR_KEY,
                    PKMN.Item.SMALL_TABLET,
                    PKMN.Item.F_DISK,
                    PKMN.Item.R_DISK,
                    PKMN.Item.L_DISK,
                    PKMN.Item.D_DISK,
                    PKMN.Item.U_DISK
                }
                    );
                ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.JAIL_KEY,
                    PKMN.Item.ELEVATOR_KEY,
                    PKMN.Item.SMALL_TABLET,
                    PKMN.Item.F_DISK,
                    PKMN.Item.R_DISK,
                    PKMN.Item.L_DISK,
                    PKMN.Item.D_DISK,
                    PKMN.Item.U_DISK
                }
                    );
            }
            else
            {
                ItemsTestsCommon.TestItemListSettingItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.KRANE_MEMO_1,
                    PKMN.Item.KRANE_MEMO_2,
                    PKMN.Item.KRANE_MEMO_3,
                    PKMN.Item.KRANE_MEMO_4,
                    PKMN.Item.KRANE_MEMO_5,
                    PKMN.Item.VOICE_CASE_1,
                    PKMN.Item.VOICE_CASE_2,
                    PKMN.Item.VOICE_CASE_3
                }
                    );
                ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                    keyItemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.KRANE_MEMO_1,
                    PKMN.Item.KRANE_MEMO_2,
                    PKMN.Item.KRANE_MEMO_3,
                    PKMN.Item.KRANE_MEMO_4,
                    PKMN.Item.KRANE_MEMO_5,
                    PKMN.Item.VOICE_CASE_1,
                    PKMN.Item.VOICE_CASE_2,
                    PKMN.Item.VOICE_CASE_3
                }
                    );
            }

            Assert.AreEqual(keyItemPocket.ValidItems.Count, keyItemPocket.ValidItemNames.Count);
            Assert.Greater(keyItemPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 15
0
        public static void TMPocketTest(
            PKMN.ItemList tmPocket,
            PKMN.Game game
            )
        {
            bool colosseum      = (game == PKMN.Game.COLOSSEUM);
            int  expectedLength = 64;

            // Check unchanging and initial values.
            Assert.AreEqual(tmPocket.Name, "TMs");
            Assert.AreEqual(tmPocket.Game, game);
            Assert.AreEqual(tmPocket.Length, expectedLength);
            Assert.AreEqual(tmPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(tmPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                tmPocket,
                PKMN.Item.TM01
                );

            // Confirm items from other pockets can't be added.
            if (colosseum)
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    tmPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.EIN_FILE_S,
                    PKMN.Item.POTION,
                    PKMN.Item.MASTER_BALL,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.JOY_SCENT
                }
                    );
            }
            else
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    tmPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.GONZAPS_KEY,
                    PKMN.Item.POTION,
                    PKMN.Item.MASTER_BALL,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.JOY_SCENT,
                    PKMN.Item.BATTLE_CD_01
                }
                    );
            }

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                tmPocket,
                new PKMN.Item[]
            {
                PKMN.Item.TM51,
                PKMN.Item.HM01
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.TM01,
                PKMN.Item.TM02,
                PKMN.Item.TM03,
                PKMN.Item.TM04,
                PKMN.Item.TM05,
                PKMN.Item.TM06,
                PKMN.Item.TM07,
                PKMN.Item.TM08
            };
            ItemsTestsCommon.TestItemListSettingItems(
                tmPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                tmPocket,
                validItems
                );

            Assert.AreEqual(tmPocket.ValidItems.Count, tmPocket.ValidItemNames.Count);
            Assert.AreEqual(tmPocket.ValidItems.Count, 50);
        }
Ejemplo n.º 16
0
        public static void ItemPocketTest(
            PKMN.ItemList itemPocket,
            PKMN.Game game
            )
        {
            bool colosseum      = (game == PKMN.Game.COLOSSEUM);
            int  expectedLength = colosseum ? 20 : 30;

            // Check unchanging and initial values.
            Assert.AreEqual(itemPocket.Name, "Items");
            Assert.AreEqual(itemPocket.Game, game);
            Assert.AreEqual(itemPocket.Length, expectedLength);
            Assert.AreEqual(itemPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(itemPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                itemPocket,
                PKMN.Item.POTION
                );

            // Confirm items from other pockets can't be added.
            if (colosseum)
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    itemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.EIN_FILE_S,
                    PKMN.Item.GREAT_BALL,
                    PKMN.Item.TM01,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.JOY_SCENT
                }
                    );
            }
            else
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    itemPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.GONZAPS_KEY,
                    PKMN.Item.GREAT_BALL,
                    PKMN.Item.TM01,
                    PKMN.Item.ORAN_BERRY,
                    PKMN.Item.BATTLE_CD_01
                }
                    );
            }

            // Confirm items from other generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                itemPocket,
                new PKMN.Item[]
            {
                PKMN.Item.PINK_BOW,
                PKMN.Item.BLACK_SLUDGE,
                PKMN.Item.BINDING_BAND,
                PKMN.Item.BEEDRILLITE
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.POTION,
                PKMN.Item.ORANGE_MAIL,
                PKMN.Item.LAVA_COOKIE,
                PKMN.Item.STARDUST,
                PKMN.Item.SHADOW_MAIL,
                PKMN.Item.PINK_SCARF,
                PKMN.Item.ANTIDOTE,
                PKMN.Item.GREEN_SHARD
            };
            ItemsTestsCommon.TestItemListSettingItems(
                itemPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                itemPocket,
                validItems
                );

            Assert.AreEqual(itemPocket.ValidItems.Count, itemPocket.ValidItemNames.Count);
            Assert.Greater(itemPocket.ValidItems.Count, 0);
        }
Ejemplo n.º 17
0
        public static void BerryPocketTest(
            PKMN.ItemList berryPocket,
            PKMN.Game game
            )
        {
            bool colosseum      = (game == PKMN.Game.COLOSSEUM);
            int  expectedLength = 46;

            // Check unchanging and initial values.
            Assert.AreEqual(berryPocket.Name, "Berries");
            Assert.AreEqual(berryPocket.Game, game);
            Assert.AreEqual(berryPocket.Length, expectedLength);
            Assert.AreEqual(berryPocket.NumItems, 0);

            // Make sure item slots start as correctly empty.
            ItemsTestsCommon.TestItemListEmptySlots(berryPocket);

            // Confirm exceptions are thrown when expected.
            ItemsTestsCommon.TestItemListIndexOutOfRangeException(
                berryPocket,
                PKMN.Item.RAZZ_BERRY
                );

            // Confirm items from other pockets can't be added.
            if (colosseum)
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    berryPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.EIN_FILE_S,
                    PKMN.Item.POTION,
                    PKMN.Item.MASTER_BALL,
                    PKMN.Item.TM01,
                    PKMN.Item.JOY_SCENT
                }
                    );
            }
            else
            {
                ItemsTestsCommon.TestItemListInvalidItems(
                    berryPocket,
                    new PKMN.Item[]
                {
                    PKMN.Item.GONZAPS_KEY,
                    PKMN.Item.POTION,
                    PKMN.Item.MASTER_BALL,
                    PKMN.Item.TM01,
                    PKMN.Item.JOY_SCENT,
                    PKMN.Item.BATTLE_CD_01
                }
                    );
            }

            // Confirm items from later generations can't be added.
            ItemsTestsCommon.TestItemListInvalidItems(
                berryPocket,
                new PKMN.Item[]
            {
                PKMN.Item.BERRY,
                PKMN.Item.OCCA_BERRY,
                PKMN.Item.ROSELI_BERRY
            }
                );

            // Start adding and removing stuff, and make sure the numbers are accurate.
            PKMN.Item[] validItems =
            {
                PKMN.Item.CHERI_BERRY,
                PKMN.Item.RAZZ_BERRY,
                PKMN.Item.LUM_BERRY,
                PKMN.Item.PINAP_BERRY,
                PKMN.Item.ASPEAR_BERRY,
                PKMN.Item.IAPAPA_BERRY,
                PKMN.Item.WIKI_BERRY,
                PKMN.Item.APICOT_BERRY
            };
            ItemsTestsCommon.TestItemListSettingItems(
                berryPocket,
                validItems
                );
            ItemsTestsCommon.TestItemListAddingAndRemovingItems(
                berryPocket,
                validItems
                );

            Assert.AreEqual(berryPocket.ValidItems.Count, berryPocket.ValidItemNames.Count);
            Assert.Greater(berryPocket.ValidItems.Count, 0);
        }