-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathResultTest.java
More file actions
32 lines (25 loc) · 978 Bytes
/
ResultTest.java
File metadata and controls
32 lines (25 loc) · 978 Bytes
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
package hackrank.algorithm.implement.caesar;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
public class ResultTest {
@Test
public void caesarCipher_RotateByThree_Expected() {
String cipher = Result.caesarCipher("a-b-c", 3);
assertThat(cipher).isEqualTo("d-e-f");
}
@Test
public void caesarCipher_RotateInPlace_RotatedToOriginalValue() {
String cipher = Result.caesarCipher("Tasty-Potato", Result.ALPHABET_ENGLISH_SIZE);
assertThat(cipher).isEqualTo("Tasty-Potato");
}
@Test
public void caesarCipher_RotateAndWrapAround_ExpectedWrap() {
String cipher = Result.caesarCipher("xyz-XYZ", 3);
assertThat(cipher).isEqualTo("abc-ABC");
}
@Test
public void caesarCipher_HackerRankSampleInput_ExpectedSampleOutput() {
String cipher = Result.caesarCipher("middle-Outz", 2);
assertThat(cipher).isEqualTo("okffng-Qwvb");
}
}