Files
commons/src/test/java/net/locusworks/test/RandomStringTest.java
Isaac Parenteau 79529ecc40 Initial Commit
2019-07-20 12:39:03 -05:00

27 lines
582 B
Java

package net.locusworks.test;
import static org.junit.Assert.*;
import org.junit.Test;
import net.locusworks.common.utils.RandomString;
public class RandomStringTest {
@Test
public void testStaticBytes() {
for (Integer length = 3; length < 50; length++) {
assertTrue(RandomString.getBytes(length).length == length);
}
}
@Test
public void testStaticString() {
for (Integer length = 3; length < 50; length++) {
String random = RandomString.getString(length);
assertTrue(random.length() == length);
}
}
}