public void ResettingStackTo0Test() { var item2 = (MockedEquippableItemInstance)_arrowsItem.Clone(); var item3 = (MockedEquippableItemInstance)_arrowsItem.Clone(); var added1 = _equippableCharacter.Equip(_arrowsItem); Assert.AreSame(_arrowsItem, _equipmentCollection[4]); Assert.AreEqual(1, _equipmentCollection.GetAmount(4)); var added2 = _equippableCharacter.Equip(item2); Assert.AreSame(item2, _equipmentCollection[4]); Assert.AreEqual(2, _equipmentCollection.GetAmount(4)); var added3 = _equippableCharacter.Equip(item3); Assert.AreSame(item3, _equipmentCollection[4]); Assert.AreEqual(3, _equipmentCollection.GetAmount(4)); var removed = _equippableCharacter.UnEquipAt(4, 3); Assert.IsNull(removed.error); Assert.IsNull(added1.error); Assert.IsNull(added2.error); Assert.IsNull(added3.error); Assert.AreEqual(1, _arrowsItem.onEquippedCallCount); Assert.AreEqual(1, _arrowsItem.onUnEquippedCallCount); Assert.AreEqual(1, item2.onEquippedCallCount); Assert.AreEqual(1, item2.onUnEquippedCallCount); Assert.AreEqual(1, item3.onEquippedCallCount); Assert.AreEqual(1, item3.onUnEquippedCallCount); // Arrows should've been unequipped by ForceAdd action. Assert.AreEqual(0, _equipmentCollection.GetAmount(_arrowsItem)); Assert.AreEqual(0, _equipmentCollection.GetAmount(4)); Assert.AreEqual(3, _restoreToCollection.GetAmount(_arrowsItem)); }
public void UnEquipAtEmptySlotTest() { var unEquipped = _equippableCharacter.UnEquipAt(0, 1); Assert.AreEqual(Errors.CollectionDoesNotContainItem, unEquipped.error); }