[count-upper-lower] some renamings were missing

This commit is contained in:
Kai.Yuan 2024-02-02 17:30:15 +01:00
parent ee12253609
commit 746c6f5083
1 changed files with 10 additions and 10 deletions

View File

@ -9,34 +9,34 @@ public class CountUpperAndLowercaseCharsUnitTest {
@Test
void whenIteratingCharArrayCompareAndCount_thenGetExpectedResult() {
int upperCnt = 0;
int lowerCnt = 0;
int upperCount = 0;
int lowerCount = 0;
for (char c : MY_STRING.toCharArray()) {
if (c >= 'A' && c <= 'Z') {
upperCnt++;
upperCount++;
}
if (c >= 'a' && c <= 'z') {
lowerCnt++;
lowerCount++;
}
}
LetterCount result = new LetterCount(upperCnt, lowerCnt);
LetterCount result = new LetterCount(upperCount, lowerCount);
assertEquals(4, result.getUppercaseCount());
assertEquals(31, result.getLowercaseCount());
}
@Test
void whenUsingCharacterIsLowerOrUpperCase_thenGetExpectedResult() {
int upperCnt = 0;
int lowerCnt = 0;
int upperCount = 0;
int lowerCount = 0;
for (char c : MY_STRING.toCharArray()) {
if (Character.isUpperCase(c)) {
upperCnt++;
upperCount++;
}
if (Character.isLowerCase(c)) {
lowerCnt++;
lowerCount++;
}
}
LetterCount result = new LetterCount(upperCnt, lowerCnt);
LetterCount result = new LetterCount(upperCount, lowerCount);
assertEquals(4, result.getUppercaseCount());
assertEquals(31, result.getLowercaseCount());
}