Add unit tests for us.codecraft.webmagic.utils.NumberUtils

These tests were written using Diffblue Cover.
master
Thomas Perkins 2019-07-29 15:58:52 +01:00
parent be892b80bf
commit 2fd0e192fd
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
package us.codecraft.webmagic.utils;
import org.junit.Assert;
import org.junit.Test;
public class NumberUtilsTest {
@Test
public void testCompareLong() {
Assert.assertEquals(0, NumberUtils.compareLong(0L, 0L));
Assert.assertEquals(1, NumberUtils.compareLong(9L, 0L));
Assert.assertEquals(-1, NumberUtils.compareLong(0L, 9L));
Assert.assertEquals(-1, NumberUtils.compareLong(-9L, 0L));
Assert.assertEquals(1, NumberUtils.compareLong(0L, -9L));
}
}