engine/maps/source/unit_tests/MapExitUtils_test.cpp
// Ensure that:
//
// - When a map doesn't have a mapping for a direction, one is added
Ensure that:
When a map doesn't have a mapping for a direction, one is added
Ensure that : When a map doesn ' t have a mapping for a direction one is added
TEST_F(SW_Engine_Maps_MapExitUtilsFixture, map_tile_exit_added_new_dir)
{
  Coordinate tile_coord(3,4);
  Direction direction = Direction::DIRECTION_SOUTH;
  map<Direction, vector<Coordinate>> tile_exits;
  add_map_tile_exit(tile_exits, direction, tile_coord);
  EXPECT_EQ(1, tile_exits.size());
  auto m_it = tile_exits.find(direction);
  EXPECT_TRUE(m_it != tile_exits.end());
  if (m_it != tile_exits.end())
  {
    vector<Coordinate> c = m_it->second;
    EXPECT_EQ(1, c.size());
    EXPECT_EQ(tile_coord, c.at(0));
  }
}
TEST_F ( SW_Engine_Maps_MapExitUtilsFixture , map_tile_exit_added_new_dir ) { Coordinate tile_coord ( 3 , 4 ) ; Direction direction = Direction :: DIRECTION_SOUTH ; map < Direction , vector < Coordinate > > tile_exits ; add_map_tile_exit ( tile_exits , direction , tile_coord ) ; EXPECT_EQ ( 1 , tile_exits . size ( ) ) ; auto m_it = tile_exits . find ( direction ) ; EXPECT_TRUE ( m_it != tile_exits . end ( ) ) ; if ( m_it != tile_exits . end ( ) ) { vector < Coordinate > c = m_it -> second ; EXPECT_EQ ( 1 , c . size ( ) ) ; EXPECT_EQ ( tile_coord , c . at ( 0 ) ) ; } }
Ensure that:
 When a map doesn't have a mapping for a direction, one is added
Ensure that : When a map doesn ' t have a mapping for a direction one is added