mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 09:59:49 -05:00
MsgUtil unit test
This commit is contained in:
1 parent
add9ba29c7
commit
a97fdf3815
1 file changed
+20
@@ -21,6 +21,7 @@ package org.maxgamer.quickshop.util;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
||||
public class MsgUtilTest {
|
||||
|
||||
@@ -34,4 +35,23 @@ public class MsgUtilTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void fillArgs() {
|
||||
String sample = "I like apple and orange";
|
||||
Assertions.assertEquals(sample, MsgUtil.fillArgs("I like {0} and {1}", "apple", "orange"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSubString() {
|
||||
String sample = "cra";
|
||||
Assertions.assertEquals(sample, MsgUtil.getSubString("Minecraft", "Mine", "ft"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isJson() {
|
||||
Assertions.assertTrue(MsgUtil.isJson("{}"));
|
||||
Assertions.assertTrue(MsgUtil.isJson("[]"));
|
||||
Assertions.assertFalse(MsgUtil.isJson("{]"));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user