Exemplo n.º 1
0
        public void TestTakeGold_TakeMoreThanPlayerHas()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            player.GiveGold(10);

            player.TakeGold(-15);
        }
Exemplo n.º 2
0
        public void TestTakeGold_NegativeAmount()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            player.GiveGold(10);

            player.TakeGold(-5);
        }
Exemplo n.º 3
0
        public void TestGiveGold_NegativeAmount()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            Assert.AreEqual(0, player.Gold);

            player.GiveGold(-5);
        }
Exemplo n.º 4
0
        public void TestTakeGold_PositiveAmount()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            player.GiveGold(10);

            player.TakeGold(4);
            Assert.AreEqual(6, player.Gold);
        }
Exemplo n.º 5
0
        public void TestTakeGold_AmountEqualToPlayersGold()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            player.GiveGold(10);

            player.TakeGold(10);
            Assert.AreEqual(0, player.Gold);
        }
Exemplo n.º 6
0
        public void TestApplyHealWhenAtMaximumHitPoints()
        {
            Player player = PlayerBuilder.CreateNew("Test");

            player.ApplyHeal(5);

            Assert.AreEqual(10, player.CurrentHitPoints);
            Assert.IsTrue(player.IsAlive);
            Assert.IsFalse(player.IsDead);
        }
Exemplo n.º 7
0
        public void TestApplyDamageAmountMoreThanCurrentHitPoints()
        {
            Player player = PlayerBuilder.CreateNew("Test");

            player.ApplyDamage(12);

            Assert.AreEqual(0, player.CurrentHitPoints);
            Assert.IsFalse(player.IsAlive);
            Assert.IsTrue(player.IsDead);
        }
Exemplo n.º 8
0
        public void TestApplyHealAfterReceivingDamage_HealMoreThanDamage()
        {
            Player player = PlayerBuilder.CreateNew("Test");

            player.ApplyDamage(6);
            player.ApplyHeal(10);

            Assert.AreEqual(10, player.CurrentHitPoints);
            Assert.IsTrue(player.IsAlive);
            Assert.IsFalse(player.IsDead);
        }
Exemplo n.º 9
0
        public void TestInitialValuesAreSetProperly()
        {
            Player player = PlayerBuilder.CreateNew("Test");

            Assert.AreEqual("Test", player.Name);
            Assert.AreEqual(10, player.CurrentHitPoints);
            Assert.AreEqual(10, player.MaximumHitPoints);
            Assert.AreEqual(1, player.Level);
            Assert.IsTrue(player.IsAlive);
            Assert.IsFalse(player.IsDead);
        }
Exemplo n.º 10
0
        public void TestLevelByGivingExperiencePoints()
        {
            Player player = PlayerBuilder.CreateNew("Test");

            Assert.AreEqual(1, player.Level);

            player.GiveExperiencePoints(99);
            Assert.AreEqual(1, player.Level);

            player.GiveExperiencePoints(1);
            Assert.AreEqual(2, player.Level);
        }