+TEST(CommonFunctions, GivenStringWithSeveralBackslashesWhenResetUnusedStringIsCalledThenStringIsReset){
+
+ // Tests for resetting an unused string.
+
+ // Given
+
+ wxString ResetUnusedStringData = "Random string with a \\\\\\\\serverpath\\\\location";
+
+ // When
+
+ ResetUnusedString(&ResetUnusedStringData);
+
+ // Then
+
+ ASSERT_EQ("Random string with a \\\\serverpath\\location", ResetUnusedStringData.ToStdString());
+
+}
+
+TEST(CommonFunctions, GivenStringWithNewlinesWhenResetUnusedStringIsCalledThenStringIsFormatted){
+
+ // Tests for resetting an unused string.
+
+ // Given
+
+ ResetUnusedStringData = "Some text \\nwith new \\nlines!";
+
+ // When
+
+ ResetUnusedString(&ResetUnusedStringData);
+
+ // Then
+
+ ASSERT_EQ("Some text \nwith new \nlines!", ResetUnusedStringData.ToStdString());
+
+}
+
+TEST(CommonFunctions, GivenStringWithSeveralCharactersWhenResetUnusedStringThenStringIsFormatted){
+
+ // Tests for resetting an unused string.
+
+ // Given
+
+ ResetUnusedStringData = "And now the list of characters: \\\\ \\n \\; \\,";
+
+ // When
+
+ ResetUnusedString(&ResetUnusedStringData);
+
+ // Then
+
+ ASSERT_EQ("And now the list of characters: \\ \n ; ,", ResetUnusedStringData.ToStdString());
+
+}
+
+TEST(CommonFunctions, ConvertToHTML){
+
+ // Tests for converting data for inserting into a HTML
+ // formatted document.
+
+ wxString ConvertToHTMLData = "The test line where < is probably better than >!";
+ ConvertToHTML(&ConvertToHTMLData);
+ ASSERT_EQ("The test line where < is probably better than >!", ConvertToHTMLData.ToStdString());
+
+ ConvertToHTMLData = "More testing &<>\n";
+ ConvertToHTML(&ConvertToHTMLData);
+ ASSERT_EQ("More testing &<><br>", ConvertToHTMLData.ToStdString());
+
+ ConvertToHTMLData = "This is the first line.\nThis is the second line.\nThis is the third line.";
+ ConvertToHTML(&ConvertToHTMLData);
+ ASSERT_EQ("This is the first line.<br>This is the second line.<br>This is the third line.", ConvertToHTMLData.ToStdString());