-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#32 Fixed umeng empty novel string exception
Signed-off-by: MewX <xiayuanzhong@gmail.com>
- Loading branch information
Showing
3 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
...ndroid/LightNovelLibrary/app/src/androidTest/java/org/mewx/wenku8/util/LightToolTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package org.mewx.wenku8.util; | ||
|
||
import android.support.test.filters.SmallTest; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
@SmallTest | ||
public class LightToolTest { | ||
|
||
@Test | ||
public void isInteger() { | ||
// true cases | ||
assertTrue(LightTool.isInteger("0")); | ||
assertTrue(LightTool.isInteger("1")); | ||
|
||
// false cases | ||
assertFalse(LightTool.isInteger("")); | ||
assertFalse(LightTool.isInteger("1.0")); | ||
assertFalse(LightTool.isInteger("1..")); | ||
assertFalse(LightTool.isInteger("a")); | ||
} | ||
|
||
@Test | ||
public void isDouble() { | ||
// true | ||
assertTrue(LightTool.isDouble("0.0")); | ||
assertTrue(LightTool.isDouble("1.0")); | ||
assertTrue(LightTool.isDouble("-1.0000009")); | ||
|
||
// false | ||
assertFalse(LightTool.isDouble("")); | ||
assertFalse(LightTool.isDouble("0")); | ||
assertFalse(LightTool.isDouble("1")); | ||
assertFalse(LightTool.isDouble("-1..0000009")); | ||
assertFalse(LightTool.isDouble("a")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters