forked from ChestShop-authors/ChestShop-3
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ItemNamingUtilsTest.java
54 lines (36 loc) · 1.34 KB
/
ItemNamingUtilsTest.java
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
package com.Acrobot.ChestShop.Tests;
import static org.junit.Assert.assertEquals;
import com.Acrobot.ChestShop.Utils.ItemNamingUtils;
import org.junit.Test;
public class ItemNamingUtilsTest {
@Test
public void testNamingCutdown() {
String sut = "Hello there! Didn't your tests fail?";
String result = ItemNamingUtils.shortenDisplayName(sut, 15);
assertEquals("HelTheDidYoTeFa", result);
}
@Test
public void testNamingCutdownWhenSingleWordsAreShorter() {
String sut = "Hi i am your, testededed!";
String result = ItemNamingUtils.shortenDisplayName(sut, 15);
assertEquals("HiIAmYour,Teste", result);
}
@Test
public void testNamingCutdownOnShortEnough() {
String sut = "Hi i am tested";
String result = ItemNamingUtils.shortenDisplayName(sut, 15);
assertEquals(sut, result);
}
@Test
public void testNamingOnlyRemoveWhitespaces() {
String sut = "Hi i am all tested";
String result = ItemNamingUtils.shortenDisplayName(sut, 15);
assertEquals("HiIAmAllTested", result);
}
@Test
public void testNamingFirstWordLongerThanSecond() {
String sut = "Regenbogenalphabet Case";
String result = ItemNamingUtils.shortenDisplayName(sut, 15);
assertEquals("RegenbogenaCase", result);
}
}