コード例 #1
0
        public void DamagePerBodyShotTest_NanoWeaveTarget_DifferentRanges()
        {
            // Arrange
            Target nanoWeaveTarget = new Target
            {
                MaxHp = 1000,
                ResistanceBodyshot = 0.2,
                ResistanceHeadshot = 0.0
            };

            // Act
            var damageAt0m                    = DamageCalculator.DamagePerBodyShot(TestWeapon, nanoWeaveTarget, 0);
            var damageAtMaxDamageRange        = DamageCalculator.DamagePerBodyShot(TestWeapon, nanoWeaveTarget, maxDamageRange);
            var damageAtMinDamageRange        = DamageCalculator.DamagePerBodyShot(TestWeapon, nanoWeaveTarget, minDamageRange);
            var damageAtBetweenMaxAndMinRange = DamageCalculator.DamagePerBodyShot(TestWeapon, nanoWeaveTarget, (maxDamageRange + minDamageRange) / 2);

            // Assert
            Assert.Equal(maxDamage * 8 / 10, damageAt0m);
            Assert.Equal(maxDamage * 8 / 10, damageAtMaxDamageRange);
            Assert.Equal(minDamage * 8 / 10, damageAtMinDamageRange);
            Assert.Equal((minDamage + maxDamage) / 2 * 8 / 10, damageAtBetweenMaxAndMinRange);
        }