JD2022-TU1/main/unittests/gameplay/Managers/Smartphone/PhoneUiData.cpp

29 lines
No EOL
983 B
C++

#include "precompiled_unittests_gameplay.h"
#include "gameplay/Managers/Smartphone/PhoneUiData.h"
#include "../tests/gtest.h"
#include "../../../engine/localisation/LocalisationManagerMock.h"
namespace ITF
{
// gtest & gmock use namespace testing
using namespace testing;
///////////////////////////////////////////////////////////////////////
TEST(PhoneUiData, test_addingActionsToPhoneItemWorks)
///////////////////////////////////////////////////////////////////////
{
// Setup
PhoneUiData::Phone_Item newItem1("TestTitle1", Path ("//NotRealUrl.com/Image1"));
PhoneUiData::Phone_Item newItem2("TestTitle2", Path ("//NotRealUrl.com/Image2"));
PhoneUiData::Phone_Action actionToAdd("FakeTitle", "NotARealCommand");
// Arrange
newItem1.addAction("ActionTitle", "ThisIsNotARealCommand");
newItem2.addAction(actionToAdd);
// Act - assert
EXPECT_BTRUE(newItem1.m_actions.size() == 1);
EXPECT_BTRUE(newItem2.m_actions.size() == 1);
}
}