+static std::map<int,int> mapExample =
+{
+ { 0, 1 }, { 1, 1 }, { 2, 1 }, { 5, 1 }, { 500, 1 }, { 2415, 1 }
+};
+static int itemIndex = 0;
+
+bool mapExistsStatus = false;
+
+TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs0WhenMapDataExistsIsCalledThenConfirmItemIndex0DoesExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = false;
+ itemIndex = 0;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(true, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs1WhenMapDataExistsIsCalledThenConfirmItemIndex1DoesExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = false;
+ itemIndex = 1;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(true, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs2WhenMapDataExistsIsCalledThenConfirmItemIndex2DoesExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = false;
+ itemIndex = 2;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(true, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsTrueAndItemIndexIs3WhenMapDataExistsIsCalledThenConfirmItemIndex3DoesntExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = true;
+ itemIndex = 3;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(false, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs5WhenMapDataExistsIsCalledThenConfirmItemIndex5DoesExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = false;
+ itemIndex = 5;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(true, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsTrueAndItemIndexIs6WhenMapDataExistsIsCalledThenConfirmItemIndex6DoesntExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = true;
+ itemIndex = 6;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(false, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs499WhenMapDataExistsIsCalledThenConfirmItemIndex499DoesntExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = false;
+ itemIndex = 499;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(false, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs500WhenMapDataExistsIsCalledThenConfirmItemIndex500DoesExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = false;
+ itemIndex = 500;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(true, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsTrueAndItemIndexIs501WhenMapDataExistsIsCalledThenConfirmItemIndex501DoesntExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = true;
+ itemIndex = 501;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(false, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsTrueAndItemIndexIs2414WhenMapDataExistsIsCalledThenConfirmItemIndex2414DoesntExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = true;
+ itemIndex = 2414;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(false, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs2415WhenMapDataExistsIsCalledThenConfirmItemIndex2415DoesExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = false;
+ itemIndex = 2415;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(true, mapExistsStatus);
+
+}
+
+TEST(CommonFunctions, GivenMapExistsStatusIsTrueAndItemIndexIs2416WhenMapDataExistsIsCalledThenConfirmItemIndex2416DoesntExist)
+{
+
+ // Tests for checking that map data exists.
+
+ // Given
+
+ mapExistsStatus = true;
+ itemIndex = 2416;
+
+ // When
+
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
+
+ // Then
+
+ ASSERT_EQ(false, mapExistsStatus);