27 lines
582 B
Java
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);
|
|
}
|
|
}
|
|
|
|
}
|