1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

vcmi: fix healing effect tests

This commit is contained in:
Konstantin
2023-03-01 13:02:50 +03:00
committed by Konstantin P
parent 42984396ff
commit 276bd5eebf
2 changed files with 17 additions and 0 deletions

View File

@@ -166,12 +166,14 @@ TEST_F(SacrificeApplyTest, ResurrectsTarget)
const uint32_t victimId = 4242;
const int32_t victimCount = 5;
const int32_t victimUnitHP = 100;
const auto pikeman = CreatureID(unitId).toCreature();
const int64_t expectedHealValue = (effectPower + victimUnitHP + effectValue) * victimCount;
auto & targetUnit = unitsFake.add(BattleSide::ATTACKER);
EXPECT_CALL(targetUnit, unitBaseAmount()).WillRepeatedly(Return(unitAmount));
EXPECT_CALL(targetUnit, unitId()).WillRepeatedly(Return(unitId));
EXPECT_CALL(targetUnit, unitType()).WillRepeatedly(Return(pikeman));
EXPECT_CALL(mechanicsMock, getEffectPower()).Times(AtLeast(1)).WillRepeatedly(Return(effectPower));
EXPECT_CALL(mechanicsMock, applySpellBonus(_, Eq(&targetUnit))).WillOnce(ReturnArg<0>());
@@ -201,6 +203,7 @@ TEST_F(SacrificeApplyTest, ResurrectsTarget)
EXPECT_CALL(targetUnit, acquire()).WillOnce(Return(targetUnitState));
EXPECT_CALL(serverMock, apply(Matcher<BattleUnitsChanged *>(_))).Times(AtLeast(1));
EXPECT_CALL(serverMock, apply(Matcher<BattleLogMessage *>(_))).Times(AtLeast(1));
setupDefaultRNG();