public void ShouldAddEquipmentToCharactersEquipment()
 {
     var c = new Player();
     var e = new TestHelpers.TestWeapon();
     EquipmentHelper.EquipEquipment(c, e);
     Assert.IsTrue(c.CharacterEquipment.Exists(x => x == e));
 }
 public void ShouldApplyPercentageArmor()
 {
     var p = new Player();
     EquipmentHelper.EquipEquipment(p, new BlessedCardboard());
     p.AddModifier(new ArmorBonusPercentage(50));
     Assert.IsTrue(p.BonusArmor == 2);
 }
 public void ShouldNotAddDuplicateActions()
 {
     var p = new Player();
     p.AddAction(new LittleHeal());
     p.AddAction(new LittleHeal());
     Assert.IsTrue(p.GetActions(false).Count(i => i is LittleHeal) == 1);
 }
 public void ShouldApplyFlatHealth()
 {
     const int playerBonusHealthRegeneration = 10;
     var p = new Player();
     p.AddModifier(new HealthRegenerationAmount(10));
     Assert.IsTrue(p.BonusHealthRegeneration == playerBonusHealthRegeneration);
 }
 public void ShouldNotBeAbleToTakeMultipleTopLevelPaths()
 {
     var p = new Player();
     p.SetLevel(2);
     p.ChooseSkill(new PathOfTheFighter());
     p.ChooseSkill(new PathOfTheWizard());
 }
 public void ShouldAddSkillPoints()
 {
     var p = new Player();
     Assert.IsTrue(p.SkillPoints == 1);
     p.LevelUp();
     Assert.IsTrue(p.SkillPoints == 2);
 }
 public void ShouldSetCash()
 {
     var p = new Player();
     var startingCash = p.Cash;
     p.SetCash(startingCash + 100);
     Assert.IsTrue(p.Cash == (startingCash + 100));
 }
 public void ShouldApplyPercentageHealth()
 {
     const int playerBonusHealthRegeneration = 1;
     var p = new Player();
     p.AddModifier(new HealthRegenerationPercentage(100));
     Assert.IsTrue(p.BonusHealthRegeneration == playerBonusHealthRegeneration);
 }
 public void ShouldAddActionsToCharacterWhenSkillChosen()
 {
     var p = new Player();
     p.LevelUp();
     Assert.IsFalse(p.GetActions(false).Exists(i => i is SpellSpear));
     p.ChooseSkill(new PathOfTheWizard());
     Assert.IsTrue(p.GetActions(false).Exists(i => i is SpellSpear));
 }
 public void ShouldAddPlayerToArena()
 {
     var p = new Player();
     var a = new Arena();
     a.BuildArenaFloor(5);
     a.AddCharacterToArena(p, Alliance.TeamOne);
     Assert.IsTrue(a.Characters.Contains(p));
 }
 public void ShouldApplyPercentageHealth()
 {
     const int playerStartingHealth = 150;
     const int playerBonusHealth = 75;
     var p = new Player();
     p.AddModifier(new HealthBonusPercentage(50));
     Assert.IsTrue(p.BonusHealth == playerBonusHealth);
 }
 public void ShouldRemovesEquipmentFromCharactersEquipment()
 {
     var c = new Player();
     var e = new TestHelpers.TestWeapon();
     EquipmentHelper.EquipEquipment(c, e);
     EquipmentHelper.UnEquipEquipment(c, e);
     Assert.IsFalse(c.CharacterEquipment.Exists(x => x == e));
 }
 public void ShouldAddModifiersToCharacterWhenSkillChosen()
 {
     var p = new Player();
     Assert.IsTrue(p.CharacterModifiers.Count == 0);
     p.LevelUp();
     p.ChooseSkill(new PathOfTheFighter());
     Assert.IsTrue(p.CharacterModifiers.Count > 0);
 }
 public void ShouldFreesCharactersEquipmentSlots()
 {
     var c = new Player();
     var e = new TestHelpers.TestWeapon();
     EquipmentHelper.EquipEquipment(c, e);
     EquipmentHelper.UnEquipEquipment(c, e);
     Assert.IsFalse(c.Slots.Exists(x => !x.SlotFree || x.SlotEquipmentName == e.Name));
 }
 public void ShouldAddPlayerToDefaultPosition()
 {
     var p = new Player();
     var a = new Arena();
     a.BuildArenaFloor(5);
     a.AddCharacterToArena(p, Alliance.TeamOne);
     Assert.IsTrue(p.ArenaLocation.GetTileLocation().XCoord == 0 && p.ArenaLocation.GetTileLocation().YCoord == 4);
 }
 public void ShouldApplyEquipmentModifiersToCharacter()
 {
     var c = new Player();
     c.LevelUp();
     c.ChooseSkill(new PathOfTheWizard());
     var e = new CastersShield();
     EquipmentHelper.EquipEquipment(c, e);
     Assert.IsTrue(c.CharacterModifiers.Exists(i => i is MagicDamagePercentage));
 }
 public void ShouldApplyPercentageMana()
 {
     var p = new Player();
     p.LevelUp();
     p.ChooseSkill(new PathOfTheWizard());
     p.GainMana(50);
     p.AddModifier(new ManaBonusPercentage(50));
     Assert.IsTrue(p.BonusMana == 100);
 }
 public void ShouldGetCashBack()
 {
     const int expectedCash = 145;
     var p = new Player();
     var sword = new Sword();
     EquipmentHelper.EquipEquipment(p, sword);
     EquipmentHelper.SellEquipment(p, p.CharacterEquipment.First(i => i is Sword));
     Assert.IsTrue(p.Cash == expectedCash);
 }
 public void ShouldEquipEquipmentIfCharacterDoesNotHaveEnoughFreeSlots()
 {
     var c = new Player();
     var e = new TestHelpers.TestWeapon();
     e.AddSlotType(new Hand());
     e.AddSlotType(new Hand());
     e.AddSlotType(new Hand());
     Assert.IsFalse(EquipmentHelper.CanEquipEquipment(c, e));
 }
 public void ShouldAffordAffordableEquipment()
 {
     var p = new Player();
     var s = new Sword();
     if (p.Cash < s.Price)
     {
         p.AddCash(s.Price);
     }
     Assert.IsTrue(EquipmentHelper.CanAffordEquipment(p, s));
 }
        public void ShouldAddCharacterToArena()
        {
            var a = new Arena();
            a.BuildArenaFloor(5);
            var c = new Player();
            c.SetName("YoMomma");
            a.AddCharacterToArena(c, Alliance.TeamOne);

            Assert.IsTrue(a.Characters.Exists(i => i.Name == "YoMomma"));
        }
 public void ShouldNotAffordUnaffordableEquipment()
 {
     var p = new Player();
     var s = new Sword();
     if (p.Cash >= s.Price)
     {
         p.SetCash(s.Price-100);
     }
     Assert.IsFalse(EquipmentHelper.CanAffordEquipment(p, s));
 }
 public void ShouldAddDumbassBotToArena()
 {
     var arena = new Arena();
     arena.BuildArenaFloor(5);
     var p = new Player();
     EquipmentHelper.EquipEquipment(p, new Sword());
     arena.AddCharacterToArena(p, Alliance.TeamOne);
     var b = new Dumbass();
     b.SetName("Dumbass Bot");
     EquipmentHelper.EquipEquipment(b, new Sword());
     arena.AddCharacterToArena(b, Alliance.TeamTwo);
 }
        public void ShouldNotHaveAttackActionWhenOutOfRange()
        {
            var a = new Arena();
            a.BuildArenaFloor(10);
            var c = new Player();
            a.AddCharacterToArena(c, Alliance.TeamOne, 0, 0);
            var o = new Dumbass();
            a.AddCharacterToArena(o, Alliance.TeamTwo, 5, 5);
            var e = new Sword();
            EquipmentHelper.EquipEquipment(c, e);
            var tile = a.SelectFloorTile(o.ArenaLocation.GetTileLocation());
            var actions = c.TargetTileAndSelectActions(tile);

            Assert.IsFalse(actions.Exists(i => i.Name == "Swing"));
        }
 public void ShouldApplyFlatArmor()
 {
     var p = new Player();
     p.AddModifier(new ArmorBonusAmount(10));
     Assert.IsTrue(p.BonusArmor == 10);
 }
 public void ShouldApplyFlatHealth()
 {
     var p = new Player();
     p.AddModifier(new HealthBonusAmount(10));
     Assert.IsTrue(p.BonusHealth == 10);
 }
 public void ShouldNotSetPlayerLocationIfArenaFloorNull()
 {
     var p = new Player();
     var a = new Arena();
     a.AddCharacterToArena(p, Alliance.TeamOne);
 }
 public void ShouldApplyFlatMana()
 {
     var p = new Player();
     p.AddModifier(new ManaBonusAmount(10));
     Assert.IsTrue(p.BonusMana == 10);
 }
 public void ShouldNotAddPlayerToArenaWhenFloorNotBuilt()
 {
     var p = new Player();
     var a = new Arena();
     a.AddCharacterToArena(p, Alliance.TeamOne);
 }
 public void ShouldNotAddCharacterToArenaWhenFloorNotBuilt()
 {
     var a = new Arena();
     var c = new Player();
     c.SetName("YoMomma");
     a.AddCharacterToArena(c, Alliance.TeamOne);
 }