コード例 #1
0
        public void SavedGameExtensionsTests_GetItemLevels_NullItemsData()
        {
            ItemsData itemsData = null;

            var itemsLevels = itemsData.GetItemLevels(MockGameData.RealData);

            Assert.NotNull(itemsLevels);
            Assert.Equal(0, itemsLevels.Count);
        }
コード例 #2
0
        public void SavedGameExtensionsTests_GetItemLevels_NullSlots()
        {
            ItemsData itemsData = new ItemsData
            {
                Slots = null,
                Items = validItems,
            };

            var itemsLevels = itemsData.GetItemLevels(MockGameData.RealData);

            Assert.NotNull(itemsLevels);
            Assert.Equal(0, itemsLevels.Count);
        }
コード例 #3
0
        public void SavedGameExtensionsTests_GetItemLevels_EmptyData()
        {
            ItemsData itemsData = new ItemsData
            {
                Slots = new Dictionary <int, int>(),
                Items = new Dictionary <int, ItemData>(),
            };

            var itemsLevels = itemsData.GetItemLevels(MockGameData.RealData);

            Assert.NotNull(itemsLevels);
            Assert.Equal(0, itemsLevels.Count);
        }
コード例 #4
0
        public void SavedGameExtensionsTests_GetItemLevels_Valid()
        {
            ItemsData itemsData = new ItemsData
            {
                Slots = validSlots,
                Items = validItems,
            };

            var itemsLevels = itemsData.GetItemLevels(MockGameData.RealData);

            Assert.NotNull(itemsLevels);
            Assert.Equal(4, itemsLevels.Count);
            Assert.Equal(40, itemsLevels[MockGameData.RealData.ItemBonusTypes[1].AncientId]);
            Assert.Equal(60, itemsLevels[MockGameData.RealData.ItemBonusTypes[2].AncientId]);
            Assert.Equal(60, itemsLevels[MockGameData.RealData.ItemBonusTypes[3].AncientId]);
            Assert.Equal(40, itemsLevels[MockGameData.RealData.ItemBonusTypes[4].AncientId]);
        }
コード例 #5
0
        public void SavedGameExtensionsTests_GetItemLevels_UnknownItems()
        {
            ItemsData itemsData = new ItemsData
            {
                Slots = validSlots,
                Items = new Dictionary <int, ItemData>
                {
                    { 199, item1 },
                    { 299, item2 },
                    { 399, item3 },
                    { 499, item4 },
                    { 599, item5 },
                },
            };

            var itemsLevels = itemsData.GetItemLevels(MockGameData.RealData);

            Assert.NotNull(itemsLevels);
            Assert.Equal(0, itemsLevels.Count);
        }
コード例 #6
0
        public void SavedGameExtensionsTests_GetItemLevels_UnknownSlots()
        {
            ItemsData itemsData = new ItemsData
            {
                Slots = new Dictionary <int, int>
                {
                    { 0, 100 }, // Slots are 1-based
                    { 91, 100 },
                    { 92, 200 },
                    { 93, 300 },
                    { 94, 400 },
                },
                Items = validItems,
            };

            var itemsLevels = itemsData.GetItemLevels(MockGameData.RealData);

            Assert.NotNull(itemsLevels);
            Assert.Equal(0, itemsLevels.Count);
        }
コード例 #7
0
        public void SavedGameExtensionsTests_GetItemLevels_ExtraSlots()
        {
            var extraSlots = new Dictionary <int, int>(validSlots);

            extraSlots.Add(5, extraSlots[1]);
            extraSlots.Add(6, extraSlots[2]);
            extraSlots.Add(7, extraSlots[3]);
            extraSlots.Add(8, extraSlots[4]);

            ItemsData itemsData = new ItemsData
            {
                Slots = extraSlots,
                Items = validItems,
            };

            var itemsLevels = itemsData.GetItemLevels(MockGameData.RealData);

            Assert.NotNull(itemsLevels);
            Assert.Equal(4, itemsLevels.Count);
            Assert.Equal(40, itemsLevels[MockGameData.RealData.ItemBonusTypes[1].AncientId]);
            Assert.Equal(60, itemsLevels[MockGameData.RealData.ItemBonusTypes[2].AncientId]);
            Assert.Equal(60, itemsLevels[MockGameData.RealData.ItemBonusTypes[3].AncientId]);
            Assert.Equal(40, itemsLevels[MockGameData.RealData.ItemBonusTypes[4].AncientId]);
        }