-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCaeserCipherTest.java
More file actions
43 lines (36 loc) · 1.05 KB
/
Copy pathCaeserCipherTest.java
File metadata and controls
43 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package basic;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
class CaeserCipherTest {
@Test
@DisplayName("caeserCipher")
void caeserCipher() {
// given
String result = CaeserCipher.solution("AB", 1);
Assertions.assertThat(result).isEqualTo("BC");
}
@Test
@DisplayName("caeserCipher")
void caeserCipher2() {
// given
String result = CaeserCipher.solution("z", 1);
Assertions.assertThat(result).isEqualTo("a");
}
@Test
@DisplayName("caeserCipher")
void caeserCipher3() {
// given
String result = CaeserCipher.solution("a B z", 4);
Assertions.assertThat(result).isEqualTo("e F d");
}
@Test
void test(){
System.out.println((int)'a');
System.out.println('z' - 'a');
int circle = 'z' - 'a';
System.out.println("circle : " + circle);
char c = (char) ('a' + ('z' - 'a' + 1) % circle );
System.out.println("c : " + c);
}
}