1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

vcmi: fix heal and teleport tests

This commit is contained in:
Konstantin P
2023-04-25 12:45:48 +03:00
parent e5f78a8997
commit 705d7164ae
6 changed files with 11 additions and 20 deletions

View File

@@ -362,6 +362,8 @@ TEST_P(HealApplyTest, Heals)
mechanicsMock.caster = &actualCaster;
EXPECT_CALL(mechanicsMock, getEffectValue()).WillRepeatedly(Return(effectValue));
EXPECT_CALL(mechanicsMock, applySpellBonus(Eq(effectValue), Eq(&targetUnit))).WillRepeatedly(Return(effectValue));
EXPECT_CALL(actualCaster, creatureIndex()).WillRepeatedly(Return(CreatureID(unitId)));
EXPECT_CALL(actualCaster, getHeroCaster()).WillRepeatedly(Return(nullptr));
GTEST_ASSERT_EQ(targetUnitState->getAvailableHealth(), unitAmount * unitHP / 2 + 1);
GTEST_ASSERT_EQ(targetUnitState->getFirstHPleft(), 1);
@@ -372,18 +374,8 @@ TEST_P(HealApplyTest, Heals)
EXPECT_CALL(actualCaster, getCasterUnitId()).WillRepeatedly(Return(-1));
//There should be battle log message if resurrect
switch(healLevel)
{
case EHealLevel::RESURRECT:
case EHealLevel::OVERHEAL:
EXPECT_CALL(serverMock, apply(Matcher<BattleLogMessage *>(_))).Times(AtLeast(1));
break;
default:
break;
}
EXPECT_CALL(serverMock, apply(Matcher<BattleUnitsChanged *>(_))).Times(1);
EXPECT_CALL(serverMock, apply(Matcher<BattleLogMessage *>(_))).Times(AtLeast(1));
setupDefaultRNG();