示例#1
0
        public void TestTakeGold_TakeMoreThanPlayerHas()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            player.GiveGold(10);

            player.TakeGold(-15);
        }
示例#2
0
        public void TestTakeGold_NegativeAmount()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            player.GiveGold(10);

            player.TakeGold(-5);
        }
示例#3
0
        public void TestGiveGold_NegativeAmount()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            Assert.AreEqual(0, player.Gold);

            player.GiveGold(-5);
        }
示例#4
0
        public void TestTakeGold_PositiveAmount()
        {
            Player player = PlayerBuilder.CreateNew("Test'");

            player.GiveGold(10);

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

            player.GiveGold(10);

            player.TakeGold(10);
            Assert.AreEqual(0, player.Gold);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }