|
|
|
@ -13,7 +13,7 @@ namespace UnitTest
|
|
|
|
TEST_F(EditorFocusModeSelectionFixture, EditorFocusModeSelectionSelectEntityWithFocusOnLevel)
|
|
|
|
TEST_F(EditorFocusModeSelectionFixture, EditorFocusModeSelectionSelectEntityWithFocusOnLevel)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Click on Car Entity
|
|
|
|
// Click on Car Entity
|
|
|
|
ClickAtWorldPositionOnViewport(WorldCarEntityPosition);
|
|
|
|
ClickAtWorldPositionOnViewport(s_worldCarEntityPosition);
|
|
|
|
|
|
|
|
|
|
|
|
// Verify entity is selected
|
|
|
|
// Verify entity is selected
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
@ -27,7 +27,7 @@ namespace UnitTest
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[StreetEntityName]);
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[StreetEntityName]);
|
|
|
|
|
|
|
|
|
|
|
|
// Click on Car Entity
|
|
|
|
// Click on Car Entity
|
|
|
|
ClickAtWorldPositionOnViewport(WorldCarEntityPosition);
|
|
|
|
ClickAtWorldPositionOnViewport(s_worldCarEntityPosition);
|
|
|
|
|
|
|
|
|
|
|
|
// Verify entity is selected
|
|
|
|
// Verify entity is selected
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
@ -41,7 +41,7 @@ namespace UnitTest
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[CarEntityName]);
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[CarEntityName]);
|
|
|
|
|
|
|
|
|
|
|
|
// Click on Car Entity
|
|
|
|
// Click on Car Entity
|
|
|
|
ClickAtWorldPositionOnViewport(WorldCarEntityPosition);
|
|
|
|
ClickAtWorldPositionOnViewport(s_worldCarEntityPosition);
|
|
|
|
|
|
|
|
|
|
|
|
// Verify entity is selected
|
|
|
|
// Verify entity is selected
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
@ -55,7 +55,7 @@ namespace UnitTest
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[SportsCarEntityName]);
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[SportsCarEntityName]);
|
|
|
|
|
|
|
|
|
|
|
|
// Click on Car Entity
|
|
|
|
// Click on Car Entity
|
|
|
|
ClickAtWorldPositionOnViewport(WorldCarEntityPosition);
|
|
|
|
ClickAtWorldPositionOnViewport(s_worldCarEntityPosition);
|
|
|
|
|
|
|
|
|
|
|
|
// Verify entity is selected
|
|
|
|
// Verify entity is selected
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
@ -68,10 +68,71 @@ namespace UnitTest
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[Passenger1EntityName]);
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[Passenger1EntityName]);
|
|
|
|
|
|
|
|
|
|
|
|
// Click on Car Entity
|
|
|
|
// Click on Car Entity
|
|
|
|
ClickAtWorldPositionOnViewport(WorldCarEntityPosition);
|
|
|
|
ClickAtWorldPositionOnViewport(s_worldCarEntityPosition);
|
|
|
|
|
|
|
|
|
|
|
|
// Verify entity is selected
|
|
|
|
// Verify entity is selected
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
EXPECT_EQ(selectedEntitiesAfter.size(), 0);
|
|
|
|
EXPECT_EQ(selectedEntitiesAfter.size(), 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(EditorFocusModeSelectionFixture, EditorFocusModeSelectionBoxSelectWithFocusOnLevel)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Do a box select that includes all entities in the fixture
|
|
|
|
|
|
|
|
BoxSelectOnViewport();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Entities are selected
|
|
|
|
|
|
|
|
using ::testing::UnorderedElementsAre;
|
|
|
|
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
|
|
|
|
EXPECT_THAT(selectedEntitiesAfter,
|
|
|
|
|
|
|
|
UnorderedElementsAre(
|
|
|
|
|
|
|
|
m_entityMap[CityEntityName],
|
|
|
|
|
|
|
|
m_entityMap[StreetEntityName],
|
|
|
|
|
|
|
|
m_entityMap[CarEntityName],
|
|
|
|
|
|
|
|
m_entityMap[Passenger1EntityName],
|
|
|
|
|
|
|
|
m_entityMap[SportsCarEntityName],
|
|
|
|
|
|
|
|
m_entityMap[Passenger2EntityName]
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(EditorFocusModeSelectionFixture, EditorFocusModeSelectionBoxSelectWithFocusOnChild)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Set the focus on the Passenger1 Entity (child of the entity)
|
|
|
|
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[StreetEntityName]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Do a box select that includes all entities in the fixture
|
|
|
|
|
|
|
|
BoxSelectOnViewport();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Entities are selected
|
|
|
|
|
|
|
|
using ::testing::UnorderedElementsAre;
|
|
|
|
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
|
|
|
|
EXPECT_THAT(selectedEntitiesAfter,
|
|
|
|
|
|
|
|
UnorderedElementsAre(
|
|
|
|
|
|
|
|
m_entityMap[StreetEntityName],
|
|
|
|
|
|
|
|
m_entityMap[CarEntityName],
|
|
|
|
|
|
|
|
m_entityMap[Passenger1EntityName],
|
|
|
|
|
|
|
|
m_entityMap[SportsCarEntityName],
|
|
|
|
|
|
|
|
m_entityMap[Passenger2EntityName]
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TEST_F(EditorFocusModeSelectionFixture, EditorFocusModeSelectionBoxSelectWithFocusOnLeaf)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Set the focus on the Passenger1 Entity (child of the entity)
|
|
|
|
|
|
|
|
m_focusModeInterface->SetFocusRoot(m_entityMap[Passenger1EntityName]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Do a box select that includes all entities in the fixture
|
|
|
|
|
|
|
|
BoxSelectOnViewport();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Entities are selected
|
|
|
|
|
|
|
|
using ::testing::UnorderedElementsAre;
|
|
|
|
|
|
|
|
auto selectedEntitiesAfter = GetSelectedEntities();
|
|
|
|
|
|
|
|
EXPECT_THAT(selectedEntitiesAfter,
|
|
|
|
|
|
|
|
UnorderedElementsAre(
|
|
|
|
|
|
|
|
m_entityMap[Passenger1EntityName]
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace UnitTest
|
|
|
|
} // namespace UnitTest
|
|
|
|
|