-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMicroBlogTest.java
More file actions
79 lines (65 loc) · 2.12 KB
/
MicroBlogTest.java
File metadata and controls
79 lines (65 loc) · 2.12 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import static org.junit.Assert.assertEquals;
import org.junit.Test;
public class MicroBlogTest {
private final MicroBlog microBlog = new MicroBlog();
@Test
public void englishLanguageShort() {
String expected = "Hi";
assertEquals(expected, microBlog.truncate("Hi"));
}
@Test
public void englishLanguageLong() {
String expected = "Hello";
assertEquals(expected, microBlog.truncate("Hello there"));
}
@Test
public void germanLanguageShort_broth() {
String expected = "brühe";
assertEquals(expected, microBlog.truncate("brühe"));
}
@Test
public void germanLanguageLong_bearCarpet_to_beards() {
String expected = "Bärte";
assertEquals(expected, microBlog.truncate("Bärteppich"));
}
@Test
public void bulgarianLanguageShort_good() {
String expected = "Добър";
assertEquals(expected, microBlog.truncate("Добър"));
}
@Test
public void greekLanguageShort_health() {
String expected = "υγειά";
assertEquals(expected, microBlog.truncate("υγειά"));
}
@Test
public void mathsShort() {
String expected = "a=πr²";
assertEquals(expected, microBlog.truncate("a=πr²"));
}
@Test
public void mathsLong() {
String expected = "∅⊊ℕ⊊ℤ";
assertEquals(expected, microBlog.truncate("∅⊊ℕ⊊ℤ⊊ℚ⊊ℝ⊊ℂ"));
}
@Test
public void englishAndEmojiShort() {
String expected = "Fly 🛫";
assertEquals(expected, microBlog.truncate("Fly 🛫"));
}
@Test
public void emojiShort() {
String expected = "💇";
assertEquals(expected, microBlog.truncate("💇"));
}
@Test
public void emojiLong() {
String expected = "❄🌡🤧🤒🏥";
assertEquals(expected, microBlog.truncate("❄🌡🤧🤒🏥🕰😀"));
}
@Test
public void royalFlush() {
String expected = "🃎🂸🃅🃋🃍";
assertEquals(expected, microBlog.truncate("🃎🂸🃅🃋🃍🃁🃊"));
}
}