Esempio n. 1
0
 public void CannotEquipEquipmentIfCharacterDoesNotHaveEnoughFreeSlots()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     e.AddSlotType(new Hand());
     e.AddSlotType(new Hand());
     e.AddSlotType(new Hand());
     Assert.IsFalse(c.CanEquipEquipment(e));
 }
Esempio n. 2
0
 public void CharacterCanPerformAttackActionWhenWithinRange()
 {
     var c = new Character();
     c.SetCharacterLocation(0, 0);
     var o = new Character();
     o.SetCharacterLocation(1, 1);
     var e = new TestHelpers.TestWeapon();
     c.EquipEquipment(e);
     var s = new TestHelpers.TestAttack();
     Assert.IsTrue(s.CanBePerformed(c, o));
 }
Esempio n. 3
0
 public void CharacterCannotPerformAttackWhenOutOfRange()
 {
     var c = new Character();
     c.SetCharacterLocation(0, 0);
     var o = new Character();
     o.SetCharacterLocation(10, 10);
     var e = new TestHelpers.TestWeapon();
     c.EquipEquipment(e);
     var s = new TestHelpers.TestAttack();
     Assert.IsFalse(s.CanBePerformed(c, o));
 }
Esempio n. 4
0
 public void EquipEquipmentUpdatesCharacterEquipmentSlotsToUsed()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     e.AddSlotType(new Hand());
     c.EquipEquipment(e);
     Assert.IsTrue(c.Slots.Exists(x => !x.SlotFree && x.SlotEquipmentName == e.Name));
 }
Esempio n. 5
0
 public void EquipEquipmentAddsEquipmentToCharactersEquipment()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     c.EquipEquipment(e);
     Assert.IsTrue(c.CharacterEquipment.Exists(x => x == e));
 }
Esempio n. 6
0
 public void WeaponDamageGetsCalculated()
 {
     var w = new TestHelpers.TestWeapon();
     var dmg = w.GetDamage();
     Assert.IsTrue((w.BaseDamage + w.BonusDamage) >= dmg && dmg >= w.BaseDamage);
 }
Esempio n. 7
0
 public void CanEquipEquipmentIfCharacterHasFreeSlots()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     Assert.IsTrue(c.CanEquipEquipment(e));
 }
Esempio n. 8
0
 public void UnEquipEquipmentRemovesEquipmentFromCharactersEquipment()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     c.EquipEquipment(e);
     c.UnEquipEquipment(e);
     Assert.IsFalse(c.CharacterEquipment.Exists(x => x == e));
 }
Esempio n. 9
0
 public void UnEquipEquipmentFreesCharactersEquipmentSlots()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     c.EquipEquipment(e);
     c.UnEquipEquipment(e);
     Assert.IsFalse(c.Slots.Exists(x => !x.SlotFree || x.SlotEquipmentName == e.Name));
 }
Esempio n. 10
0
 public void PlayerHasAvailableActionsFromEquippedEquipment()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     c.EquipEquipment(e);
     var e2 = new TestHelpers.TestWeapon2();
     c.EquipEquipment(e2);
     Assert.IsTrue(c.AvailableActions.Exists(i => i.Name == "Test Attack") && c.AvailableActions.Exists(i => i.Name == "Test Attack2"));
 }
Esempio n. 11
0
 public void PlayerAvailableActionsAreDistinct()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     c.EquipEquipment(e);
     c.EquipEquipment(e);
     Assert.IsTrue(c.AvailableActions.FindAll(i => i.Name == "Test Attack").Count == 1);
 }
Esempio n. 12
0
 public void EquipEquipmentWhenCharacterDoesNotHaveEnoughFreeSlotsThrowsException()
 {
     var c = new Character();
     var e = new TestHelpers.TestWeapon();
     e.AddSlotType(new Hand());
     e.AddSlotType(new Hand());
     e.AddSlotType(new Hand());
     c.EquipEquipment(e);
 }