// Given
- EscapeStringData = "Here we go, an \"example\" of escaping string.";
+ wxString EscapeStringData = "Here we go, an \"example\" of escaping string.";
// When
// Given
- EscapeStringData = "Lets put some \nnew \nlines \nin \nhere.";
+ wxString EscapeStringData = "Lets put some \nnew \nlines \nin \nhere.";
// When
// Given
- EscapeStringData = "Lets put some \r\nnew \r\nlines \r\nin \r\nhere.";
+ wxString EscapeStringData = "Lets put some \r\nnew \r\nlines \r\nin \r\nhere.";
// When
// Given
- EscapeStringData = "A:\\path\\example\\lets\\have\\some\\fun";
+ wxString EscapeStringData = "A:\\path\\example\\lets\\have\\some\\fun";
// When
// Given
- CaptureStringData = "Here we go\\, an \"example\" of escaping string.";
+ wxString CaptureStringData = "Here we go\\, an \"example\" of escaping string.";
// When
// Given
- CaptureStringData = "Lets put some \\nnew \\nlines \\nin \\nhere.";
+ wxString CaptureStringData = "Lets put some \\nnew \\nlines \\nin \\nhere.";
// When
// Given
- CaptureStringData = "A:\\\\path\\\\example\\\\lets\\\\have\\\\some\\\\fun";
+ wxString CaptureStringData = "A:\\\\path\\\\example\\\\lets\\\\have\\\\some\\\\fun";
// When
// Given
- ResetUnusedStringData = "Some text \\nwith new \\nlines!";
+ wxString ResetUnusedStringData = "Some text \\nwith new \\nlines!";
// When
// Given
- ResetUnusedStringData = "And now the list of characters: \\\\ \\n \\; \\,";
+ wxString ResetUnusedStringData = "And now the list of characters: \\\\ \\n \\; \\,";
// When
// Given
- ConvertToHTMLData = "More testing &<>\n";
+ wxString ConvertToHTMLData = "More testing &<>\n";
// When
// Given
- ConvertToHTMLData = "This is the first line.\nThis is the second line.\nThis is the third line.";
+ wxString ConvertToHTMLData = "This is the first line.\nThis is the second line.\nThis is the third line.";
// When
}
-static std::map<int,int> mapExample;
+static std::map<int,int> mapExample =
+{
+ { 0, 1 }, { 1, 1 }, { 2, 1 }, { 5, 1 }, { 500, 1 }, { 2415, 1 }
+};
static int itemIndex = 0;
-static mapExample.insert(std::make_pair(0,1));
-static mapExample.insert(std::make_pair(1,1));
-static mapExample.insert(std::make_pair(2,1));
-static mapExample.insert(std::make_pair(5,1));
-static mapExample.insert(std::make_pair(500,1));
-static mapExample.insert(std::make_pair(2415,1));
-static mapExistsStatus = false;
+bool mapExistsStatus = false;
TEST(CommonFunctions, GivenMapExistsStatusIsFalseAndItemIndexIs0WhenMapDataExistsIsCalledThenConfirmItemIndex0DoesExist)
{
// Given
- mapStatusExists = false;
+ mapExistsStatus = false;
itemIndex = 2;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(true, mapStatusExists);
+ ASSERT_EQ(true, mapExistsStatus);
}
// Given
- mapStatusExists = true;
+ mapExistsStatus = true;
itemIndex = 3;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(false, mapStatusExists);
+ ASSERT_EQ(false, mapExistsStatus);
}
// Given
- mapStatusExists = false;
+ mapExistsStatus = false;
itemIndex = 5;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(true, mapStatusExists);
+ ASSERT_EQ(true, mapExistsStatus);
}
// Given
- mapStatusExists = true;
+ mapExistsStatus = true;
itemIndex = 6;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(false, mapStatusExists);
+ ASSERT_EQ(false, mapExistsStatus);
}
// Given
- mapStatusExists = false;
+ mapExistsStatus = false;
itemIndex = 499;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(false, mapStatusExists);
+ ASSERT_EQ(false, mapExistsStatus);
}
// Given
- mapStatusExists = false;
+ mapExistsStatus = false;
itemIndex = 500;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(true, mapStatusExists);
+ ASSERT_EQ(true, mapExistsStatus);
}
// Given
- mapStatusExists = true;
+ mapExistsStatus = true;
itemIndex = 501;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(false, mapStatusExists);
+ ASSERT_EQ(false, mapExistsStatus);
}
// Given
- mapStatusExists = true;
+ mapExistsStatus = true;
itemIndex = 2414;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(false, mapStatusExists);
+ ASSERT_EQ(false, mapExistsStatus);
}
// Given
- mapStatusExists = false;
+ mapExistsStatus = false;
itemIndex = 2415;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(true, mapStatusExists);
+ ASSERT_EQ(true, mapExistsStatus);
}
// Given
- mapStatusExists = true;
+ mapExistsStatus = true;
itemIndex = 2416;
// When
- mapStatusExists = MapDataExists(&itemIndex, &mapExample);
+ mapExistsStatus = MapDataExists(&itemIndex, &mapExample);
// Then
- ASSERT_EQ(false, mapStatusExists);
+ ASSERT_EQ(false, mapExistsStatus);
}
\ No newline at end of file
ContactDataObject testFile;
ContactLoadStatus testFileLoadStatus = CONTACTLOAD_UNITTESTFAIL;
- testFileLoadStatus = testFile1.LoadFile("LoadCheck-Load1.vcf");
+ testFileLoadStatus = testFile.LoadFile("LoadCheck-Load1.vcf");
ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);
ContactDataObject testFile2;
ContactDataObject testFile3;
- ContactLoadStatus testFile1SaveStatus = CONTACTSAVE_UNITTESTFAIL;
- ContactSaveStatus testFile1LoadStatus = CONTACTLOAD_UNITTESTFAIL;
+ ContactLoadStatus testFile1LoadStatus = CONTACTLOAD_UNITTESTFAIL;
+ ContactSaveStatus testFile1SaveStatus = CONTACTSAVE_UNITTESTFAIL;
- ContactLoadStatus testFile2SaveStatus = CONTACTSAVE_UNITTESTFAIL;
- ContactSaveStatus testFile2LoadStatus = CONTACTLOAD_UNITTESTFAIL;
+ ContactLoadStatus testFile2LoadStatus = CONTACTLOAD_UNITTESTFAIL;
+ ContactSaveStatus testFile2SaveStatus = CONTACTSAVE_UNITTESTFAIL;
- ContactLoadStatus testFile3SaveStatus = CONTACTSAVE_UNITTESTFAIL;
- ContactSaveStatus testFile3LoadStatus = CONTACTLOAD_UNITTESTFAIL;
+ ContactLoadStatus testFile3LoadStatus = CONTACTLOAD_UNITTESTFAIL;
+ ContactSaveStatus testFile3SaveStatus = CONTACTSAVE_UNITTESTFAIL;
// When
ContactLoadStatus testFileLoadStatus = CONTACTLOAD_UNITTESTFAIL;
ContactSaveStatus testFileSaveStatus = CONTACTSAVE_UNITTESTFAIL;
- testFileLoadStatus = testFile1.LoadFile("LoadCheck-Load1.vcf");
+ testFileLoadStatus = testFile.LoadFile("LoadCheck-Load1.vcf");
ASSERT_EQ(CONTACTLOAD_OK, testFileLoadStatus);