From 9b074c8a1eb932c441d74bb037c8101c49d1a601 Mon Sep 17 00:00:00 2001 From: "Bruce.Deng" Date: Mon, 14 Oct 2019 14:04:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E6=8E=A5=E5=8F=A3=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fanruan/api/report/UnitKitTest.java | 20 +++++++++++++++++++ .../com/fanruan/api/util/CodeKitTest.java | 7 ++++++- .../com/fanruan/api/util/GeneralKitTest.java | 16 +++++++++++++-- 3 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 src/test/java/com/fanruan/api/report/UnitKitTest.java diff --git a/src/test/java/com/fanruan/api/report/UnitKitTest.java b/src/test/java/com/fanruan/api/report/UnitKitTest.java new file mode 100644 index 0000000..f4eb166 --- /dev/null +++ b/src/test/java/com/fanruan/api/report/UnitKitTest.java @@ -0,0 +1,20 @@ +package com.fanruan.api.report; + +import com.fr.stable.unit.FU; +import org.junit.Assert; +import org.junit.Test; + +public class UnitKitTest { + + @Test + public void unit4CompatibleInchDV() { + String str1 = "100"; + Assert.assertEquals(UnitKit.unit4CompatibleInchDV(str1), FU.getInstance(365760000)); + } + + @Test + public void unit4CompatibleMMDV() { + String str1 = "100"; + Assert.assertEquals(UnitKit.unit4CompatibleMMDV(str1), FU.getInstance(14400000)); + } +} \ No newline at end of file diff --git a/src/test/java/com/fanruan/api/util/CodeKitTest.java b/src/test/java/com/fanruan/api/util/CodeKitTest.java index 400a2b2..4977edc 100644 --- a/src/test/java/com/fanruan/api/util/CodeKitTest.java +++ b/src/test/java/com/fanruan/api/util/CodeKitTest.java @@ -1,7 +1,6 @@ package com.fanruan.api.util; import com.fr.stable.CodeUtils; -import com.fr.stable.CommonCodeUtils; import org.junit.Assert; import org.junit.Test; @@ -36,4 +35,10 @@ public class CodeKitTest { } } + + @Test + public void jsonEncode() { + String s = "aaa"; + Assert.assertEquals(CodeKit.jsonEncode(s),"\"aaa\""); + } } diff --git a/src/test/java/com/fanruan/api/util/GeneralKitTest.java b/src/test/java/com/fanruan/api/util/GeneralKitTest.java index 12882ee..5481651 100644 --- a/src/test/java/com/fanruan/api/util/GeneralKitTest.java +++ b/src/test/java/com/fanruan/api/util/GeneralKitTest.java @@ -2,8 +2,6 @@ package com.fanruan.api.util; import com.fanruan.api.Prepare; import com.fr.general.GeneralUtils; -import com.fr.stable.AssistUtils; -import com.fr.stable.xml.XMLableReader; import org.junit.Assert; import org.junit.Test; @@ -44,6 +42,20 @@ public class GeneralKitTest extends Prepare { Assert.assertEquals(GeneralKit.compare(s,s2),1); } + @Test + public void equals() { + String str1 = "a"; + String str2 = "a"; + String str3 = "b"; + int i1 = 1; + int i2 = 1; + int i3 = 2; + Assert.assertEquals(GeneralKit.equals(str1,str2),true); + Assert.assertEquals(GeneralKit.equals(str1,str3),false); + Assert.assertEquals(GeneralKit.equals(i1,i2),true); + Assert.assertEquals(GeneralKit.equals(i1,i3),false); + } + @Test public void join() { Object obj[] = {1, 2, 3, 4};