Esempio n. 1
0
        public void SwapSameItem()
        {
            var swordClone = (MockedEquippableItemInstance)_swordItem.Clone();

            var set1    = _character.EquipAt(3, swordClone, 1);
            var set2    = _character.EquipAt(4, _swordItem, 1);
            var swapped = _character.SwapOrMerge(4, 3);

            Assert.IsNull(set1.error);
            Assert.IsNull(set2.error);
            Assert.IsNull(swapped.error);

            Assert.AreSame(swordClone, _equipmentCollection[4]);
            Assert.AreSame(_swordItem, _equipmentCollection[3]);

            Assert.AreEqual(1, _swordItem.onEquippedCallCount);
            Assert.AreEqual(0, _swordItem.onUnEquippedCallCount);

            Assert.AreEqual(1, swordClone.onEquippedCallCount);
            Assert.AreEqual(0, swordClone.onUnEquippedCallCount);
        }
        public void SwapCompatibleItemsTest()
        {
            var set     = _equippableCharacter.EquipAt(3, _swordItem);
            var swapped = _equippableCharacter.SwapOrMerge(3, 4);

            Assert.IsNull(set.error);
            Assert.IsNull(swapped.error);
        }