summaryrefslogtreecommitdiffstats
path: root/StringTools/Test
diff options
context:
space:
mode:
Diffstat (limited to 'StringTools/Test')
-rw-r--r--StringTools/Test/Lower.cpp30
-rw-r--r--StringTools/Test/Upper.cpp30
2 files changed, 56 insertions, 4 deletions
diff --git a/StringTools/Test/Lower.cpp b/StringTools/Test/Lower.cpp
index c45af68..941cdb3 100644
--- a/StringTools/Test/Lower.cpp
+++ b/StringTools/Test/Lower.cpp
@@ -183,17 +183,43 @@ namespace _StringTools
Assert::AreEqual("öóòô", out.c_str());
}
+ // Tests that lowering already lowered umlautes returns itself
+ TEST_METHOD(Umlautes_already_lower_i)
+ {
+ // Setup
+ const std::string in = "íìî";
+
+ // Exercise
+ const std::string out = StringTools::Lower(in);
+
+ // Verify
+ Assert::AreEqual("íìî", out.c_str());
+ }
+
+ // Tests that lowering uppercase umlautes returns the lowered umlautes
+ TEST_METHOD(Umlautes_upper_i)
+ {
+ // Setup
+ const std::string in = "ÍÌÎ";
+
+ // Exercise
+ const std::string out = StringTools::Lower(in);
+
+ // Verify
+ Assert::AreEqual("íìî", out.c_str());
+ }
+
// Tests that lowering a string of uppercase, lowercase letters and symbols returns the lowercase version, even with umlauts
TEST_METHOD(Mixed_with_umlautes)
{
// Setup
- const std::string in = "Ügh, Àrä Yóü Seriöûs?! DÓN'T DÒ THÄT!!!";
+ const std::string in = "Ügh, Àrä Yóü Serîöûs?! DÓN'T DÒ THÄT!!!";
// Exercise
const std::string out = StringTools::Lower(in);
// Verify
- Assert::AreEqual("ügh, àrä yóü seriöûs?! dón't dò thät!!!", out.c_str());
+ Assert::AreEqual("ügh, àrä yóü serîöûs?! dón't dò thät!!!", out.c_str());
return;
}
};
diff --git a/StringTools/Test/Upper.cpp b/StringTools/Test/Upper.cpp
index cbefee7..1e7684b 100644
--- a/StringTools/Test/Upper.cpp
+++ b/StringTools/Test/Upper.cpp
@@ -183,17 +183,43 @@ namespace _StringTools
Assert::AreEqual("ÖÓÒÔ", out.c_str());
}
+ // Tests that lowering already lowered umlautes returns itself
+ TEST_METHOD(Umlautes_already_upper_i)
+ {
+ // Setup
+ const std::string in = "ÍÌÎ";
+
+ // Exercise
+ const std::string out = StringTools::Upper(in);
+
+ // Verify
+ Assert::AreEqual("ÍÌÎ", out.c_str());
+ }
+
+ // Tests that lowering uppercase umlautes returns the lowered umlautes
+ TEST_METHOD(Umlautes_upper_i)
+ {
+ // Setup
+ const std::string in = "íìî";
+
+ // Exercise
+ const std::string out = StringTools::Upper(in);
+
+ // Verify
+ Assert::AreEqual("ÍÌÎ", out.c_str());
+ }
+
// Tests that uppering a string of uppercase, lowercase letters and symbols returns the lowercase version, even with umlauts
TEST_METHOD(Mixed_with_umlautes)
{
// Setup
- const std::string in = "Ügh, Àrä Yóü Seriöûs?! DÒN'T DÔ THÄT!!!";
+ const std::string in = "Ügh, Àrä Yóü Serîöûs?! DÒN'T DÔ THÄT!!!";
// Exercise
const std::string out = StringTools::Upper(in);
// Verify
- Assert::AreEqual("ÜGH, ÀRÄ YÓÜ SERIÖÛS?! DÒN'T DÔ THÄT!!!", out.c_str());
+ Assert::AreEqual("ÜGH, ÀRÄ YÓÜ SERÎÖÛS?! DÒN'T DÔ THÄT!!!", out.c_str());
return;
}
};