-
-
Notifications
You must be signed in to change notification settings - Fork 314
Expand file tree
/
Copy pathTestMakingAnagrams.java
More file actions
50 lines (36 loc) · 1.09 KB
/
TestMakingAnagrams.java
File metadata and controls
50 lines (36 loc) · 1.09 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
44
45
46
47
48
49
50
package com.hackerrank.algorithms.strings;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.Test;
class TestMakingAnagrams {
@Test
void testWithStringEmpty() {
String a1 = "";
String a2 = "";
int resultA = 0;
int countA = MakingAnagrams.makeAnagrams(a1, a2);
assertEquals(countA, resultA);
String b1 = "";
String b2 = "1234567890qwertyuiop";
int resultB = 20;
int countB = MakingAnagrams.makeAnagrams(b1, b2);
assertEquals(countB, resultB);
}
@Test
void testWithStringAllCharacter() {
String a1 = "1234567890 ~!@#$%^";
String a2 = "&*()-+1234567890 ";
int resultA = 13;
int countA = MakingAnagrams.makeAnagrams(a1, a2);
assertEquals(countA, resultA);
String b1 = "asdfghjklb1234567890 ";
String b2 = "1234567890 qwertyuiop";
int resultB = 20;
int countB = MakingAnagrams.makeAnagrams(b1, b2);
assertEquals(countB, resultB);
String c1 = "hello my world";
String c2 = "this is my world";
int resultC = 10;
int countC = MakingAnagrams.makeAnagrams(c1, c2);
assertEquals(countC, resultC);
}
}