#include "../common/dirs.h"
#include "../common/filename.h"
#include "../common/mime.h"
-#include "../common/svrblist.h"
+#include "../common/svrdlist.h"
#include "../common/textprocessing.h"
static wxString AccountInput1 = "Example1";
}
-TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckBlacklistIsCalledThenReturnsCorrectStatus)
+TEST(CommonFunctions, GivenTwoDomainNamesWhenCheckDangerousListIsCalledThenReturnsCorrectStatus)
{
- // Test that the blacklist is actually working.
+ // Test that the dangerous list is actually working.
// Given
// When
- domainStatus = CheckBlacklist("example.com");
+ domainStatus = CheckDangerousList("example.com");
// Then
// When
domainStatus = false;
- domainStatus = CheckBlacklist("google.com");
+ domainStatus = CheckDangerousList("google.com");
// Then
// 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