示例#1
0
        public void Character_Cannot_Deal_Damage_To_Itself()
        {
            // Arrange
            var character = _testsFixture.GenerateRangedGighter();

            //Act & Assert
            Assert.Throws <Exception>(() => character.DealDamage(character, 50));
        }
示例#2
0
        public void Newly_Created_Characters_Belong_To_No_Faction()
        {
            // Arrange && Act
            var character = _testsFixture.GenerateRangedGighter();

            // Assert
            Assert.Empty(character.GetFactions());
        }
示例#3
0
        public void Characters_Can_Damage_Non_Character_Things_Props(double health)
        {
            // Arrange
            var character = _testsFixture.GenerateRangedGighter();
            var tree      = _testsFixture.GenerateTree(health);

            // Act
            character.DealDamage(tree, 1);

            // Assert
            Assert.Equal(health - 1, tree.Health);
            Assert.False(tree.Destroyed);
        }
示例#4
0
        public void RangedGighter_Created_Health_Equals_1000()
        {
            // Arrange e Act
            var rangedGighter = _testsFixture.GenerateRangedGighter();

            // Assert
            Assert.Equal(1000, rangedGighter.Health);
        }
示例#5
0
        public void Characters_Must_Be_In_Range_To_Deal_Damage_To_A_Target(double damage)
        {
            // Arrange
            var attacker = _testsFixture.GenerateRangedGighter();
            var target   = _testsFixture.GenerateMeleeFighter();

            // Act
            _testsFixture.Run(3, target);
            var targetHealthBeforeDamage = target.Health;

            attacker.DealDamage(target, damage);

            // Assert
            Assert.Equal(targetHealthBeforeDamage - damage, target.Health);
        }