1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

vcmi: entity tests passed

This commit is contained in:
Konstantin
2023-02-28 14:59:02 +03:00
committed by Konstantin P
parent 2680046dd0
commit 56601a0c2a
6 changed files with 33 additions and 7 deletions

View File

@ -41,13 +41,19 @@ TEST_F(CFactionTest, HasTown)
TEST_F(CFactionTest, RegistersNoIconsIfNoTown)
{
auto cb = std::bind(&CFactionTest::registarCb, this, _1, _2, _3, _4);
auto cb = [this](auto && PH1, auto && PH2, auto && PH3, auto && PH4)
{
registarCb(std::forward<decltype(PH1)>(PH1), std::forward<decltype(PH2)>(PH2), std::forward<decltype(PH3)>(PH3), std::forward<decltype(PH4)>(PH4));
};
subject->registerIcons(cb);
}
TEST_F(CFactionTest, RegistersIcons)
{
auto cb = std::bind(&CFactionTest::registarCb, this, _1, _2, _3, _4);
auto cb = [this](auto && PH1, auto && PH2, auto && PH3, auto && PH4)
{
registarCb(std::forward<decltype(PH1)>(PH1), std::forward<decltype(PH2)>(PH2), std::forward<decltype(PH3)>(PH3), std::forward<decltype(PH4)>(PH4));
};
subject->town = new CTown();
@ -67,6 +73,8 @@ TEST_F(CFactionTest, RegistersIcons)
info.iconSmall[0][1] = "Test20";
info.iconSmall[1][0] = "Test30";
info.iconSmall[1][1] = "Test40";
info.towerIconSmall = "Test5";
info.towerIconLarge = "Test6";
EXPECT_CALL(*this, registarCb(Eq(10), Eq(0), "ITPT", "Test1"));
@ -79,6 +87,9 @@ TEST_F(CFactionTest, RegistersIcons)
EXPECT_CALL(*this, registarCb(Eq(14), Eq(0), "ITPA", "Test30"));
EXPECT_CALL(*this, registarCb(Eq(15), Eq(0), "ITPA", "Test40"));
EXPECT_CALL(*this, registarCb(Eq(0), Eq(1), "CPRSMALL", "Test5"));
EXPECT_CALL(*this, registarCb(Eq(0), Eq(1), "TWCRPORT", "Test6"));
subject->registerIcons(cb);
}