@@ -54,11 +54,46 @@ TEST_F(StringUtilsTest, test_split_with_separator_size_two)
5454 });
5555}
5656
57- TEST_F (StringUtilsTest, test_split_with_empty_str )
57+ TEST_F (StringUtilsTest, test_to_upper_with_empty_str )
5858{
5959 with_str (" " );
60- do_split_with_sep (" " );
61- assert_terms_are ({" " });
60+ do_to_upper ();
61+ assert_result_is (" " );
62+ }
63+ 64+ TEST_F (StringUtilsTest, test_to_upper_with_lower_str_size_one)
65+ {
66+ with_str (" h" );
67+ do_to_upper ();
68+ assert_result_is (" H" );
69+ }
70+ 71+ TEST_F (StringUtilsTest, test_to_upper_with_lower_str_size_two)
72+ {
73+ with_str (" he" );
74+ do_to_upper ();
75+ assert_result_is (" HE" );
76+ }
77+ 78+ TEST_F (StringUtilsTest, test_to_upper_with_upper_str_size_one)
79+ {
80+ with_str (" H" );
81+ do_to_upper ();
82+ assert_result_is (" H" );
83+ }
84+ 85+ TEST_F (StringUtilsTest, test_to_upper_with_upper_str_size_two)
86+ {
87+ with_str (" HE" );
88+ do_to_upper ();
89+ assert_result_is (" HE" );
90+ }
91+ 92+ TEST_F (StringUtilsTest, test_to_upper_with_upper_and_lower_str)
93+ {
94+ with_str (" hEllo wOrlD" );
95+ do_to_upper ();
96+ assert_result_is (" HELLO WORLD" );
6297}
6398
6499TEST_F (StringUtilsTest, test_replace_all_with_one_value_and_new_value_with_size_one)
@@ -94,6 +129,19 @@ void StringUtilsTest::assert_terms_are(std::vector<std::string> expected_terms)
94129 EXPECT_EQ (expected_terms, obtained_terms);
95130}
96131
132+ void StringUtilsTest::do_to_upper ()
133+ {
134+ obtained_result = StringUtils::to_upper (selected_string);
135+ }
136+ 137+ void StringUtilsTest::assert_result_is (std::string expected_result)
138+ {
139+ EXPECT_STREQ (
140+ expected_result.c_str (),
141+ obtained_result.c_str ()
142+ );
143+ }
144+ 97145void StringUtilsTest::do_replace_all_with_old_and_new_value (
98146 std::string old_value,
99147 std::string new_value
@@ -107,13 +155,3 @@ void StringUtilsTest::do_replace_all_with_old_and_new_value(
107155
108156
109157}
110- 111- void StringUtilsTest::assert_result_is (std::string expected_result)
112- {
113- EXPECT_STREQ (
114- expected_result.c_str (),
115- obtained_result.c_str ()
116- );
117- }
118- 119-
0 commit comments