1
1
/*
2
- * Copyright (c) 2022 Oracle and/or its affiliates.
2
+ * Copyright (c) 2022, 2024 Oracle and/or its affiliates.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
19
19
20
20
import static org .hamcrest .CoreMatchers .is ;
21
21
import static org .hamcrest .MatcherAssert .assertThat ;
22
- import static org .junit .jupiter .api .Assertions .assertEquals ;
23
- import static org .junit .jupiter .api .Assertions .assertFalse ;
24
- import static org .junit .jupiter .api .Assertions .assertTrue ;
25
22
26
23
class AsciiTest {
27
24
@ Test
28
25
void testIsLowerCaseOne () {
29
- assertFalse (Ascii .isLowerCase ('{' ));
26
+ assertThat (Ascii .isLowerCase ('{' ), is ( false ));
30
27
}
31
28
32
29
@ Test
33
30
void testIsLowerCaseReturningTrue () {
34
- assertTrue (Ascii .isLowerCase ('o' ));
31
+ assertThat (Ascii .isLowerCase ('o' ), is ( true ));
35
32
}
36
33
37
34
@ Test
38
35
void testIsLowerCaseTwo () {
39
- assertFalse (Ascii .isLowerCase ('\"' ));
36
+ assertThat (Ascii .isLowerCase ('\"' ), is ( false ));
40
37
}
41
38
42
39
@ Test
@@ -52,32 +49,32 @@ void testToLowerCaseChar() {
52
49
void testToLowerCaseTakingCharSequenceOne () {
53
50
StringBuilder stringBuilder = new StringBuilder ("uhho^s} b'jdwtym" );
54
51
55
- assertEquals ( "uhho^s} b'jdwtym" , Ascii . toLowerCase ( stringBuilder ));
52
+ assertThat ( Ascii . toLowerCase ( stringBuilder ), is ( "uhho^s} b'jdwtym" ));
56
53
}
57
54
58
55
@ Test
59
56
void testToLowerCaseTakingCharSequenceTwo () {
60
- assertEquals ( "uhho^s} b'jdwtym" , Ascii .toLowerCase ((CharSequence ) "uHHO^S} b'jDwTYM" ));
57
+ assertThat ( Ascii .toLowerCase ((CharSequence ) "uHHO^S} b'jDwTYM" ), is ( "uhho^s} b'jdwtym " ));
61
58
}
62
59
63
60
@ Test
64
61
void testToLowerCaseTakingString () {
65
- assertEquals ( "" , Ascii . toLowerCase ("" ));
62
+ assertThat ( Ascii . toLowerCase ( "" ), is ("" ));
66
63
}
67
64
68
65
@ Test
69
66
void testIsUpperCaseOne () {
70
- assertFalse (Ascii .isUpperCase ('{' ));
67
+ assertThat (Ascii .isUpperCase ('{' ), is ( false ));
71
68
}
72
69
73
70
@ Test
74
71
void testIsUpperCaseReturningTrue () {
75
- assertTrue (Ascii .isUpperCase ('O' ));
72
+ assertThat (Ascii .isUpperCase ('O' ), is ( true ));
76
73
}
77
74
78
75
@ Test
79
76
void testIsUpperCaseTwo () {
80
- assertFalse (Ascii .isUpperCase ('\"' ));
77
+ assertThat (Ascii .isUpperCase ('\"' ), is ( false ));
81
78
}
82
79
83
80
@ Test
@@ -93,16 +90,16 @@ void testToUpperCaseChar() {
93
90
void testToUpperCaseTakingCharSequenceOne () {
94
91
StringBuilder stringBuilder = new StringBuilder ("UhHO^S} B'JDWTYM" );
95
92
96
- assertEquals ( "UHHO^S} B'JDWTYM" , Ascii . toUpperCase ( stringBuilder ));
93
+ assertThat ( Ascii . toUpperCase ( stringBuilder ), is ( "UHHO^S} B'JDWTYM" ));
97
94
}
98
95
99
96
@ Test
100
97
void testToUpperCaseTakingCharSequenceTwo () {
101
- assertEquals ( "UHHO^S} B'JDWTYM" , Ascii .toUpperCase ((CharSequence ) "uHHO^S} b'jDwTYM" ));
98
+ assertThat ( Ascii .toUpperCase ((CharSequence ) "uHHO^S} b'jDwTYM" ), is ( "UHHO^S} B'JDWTYM " ));
102
99
}
103
100
104
101
@ Test
105
102
void testToUpperCaseTakingString () {
106
- assertEquals ( "UHHO ^S} B'JDWTYM" , Ascii . toUpperCase ( "uHHO ^S} b'jDwTYM " ));
103
+ assertThat ( Ascii . toUpperCase ( "uHHO ^S} b'jDwTYM" ), is ( "UHHO ^S} B'JDWTYM " ));
107
104
}
108
105
}
0 commit comments