minor testing work

This commit is contained in:
eugenp 2014-08-05 09:50:16 +03:00
parent df385e01c2
commit 5aa9389a19
1 changed files with 21 additions and 0 deletions

View File

@ -17,6 +17,13 @@ public class CoreJavaRandomUnitTest {
System.out.println(generatedLong); System.out.println(generatedLong);
} }
@Test
public void givenUsingApacheCommons_whenGeneratingRandomLongUnbounded_thenCorrect() {
final long generatedLong = new RandomDataGenerator().getRandomGenerator().nextLong();
System.out.println(generatedLong);
}
@Test @Test
public void givenUsingPlainJava_whenGeneratingRandomLongBounded_thenCorrect() { public void givenUsingPlainJava_whenGeneratingRandomLongBounded_thenCorrect() {
final long leftLimit = 1L; final long leftLimit = 1L;
@ -53,6 +60,13 @@ public class CoreJavaRandomUnitTest {
System.out.println(generatedInteger); System.out.println(generatedInteger);
} }
@Test
public void givenUsingApache_whenGeneratingRandomIntegerUnbounded_thenCorrect() {
final Integer generatedInteger = new RandomDataGenerator().getRandomGenerator().nextInt();
System.out.println(generatedInteger);
}
@Test @Test
public void givenUsingApache_whenGeneratingRandomIntegerBounded_thenCorrect() { public void givenUsingApache_whenGeneratingRandomIntegerBounded_thenCorrect() {
final int leftLimit = 1; final int leftLimit = 1;
@ -71,6 +85,13 @@ public class CoreJavaRandomUnitTest {
System.out.println(generatedFloat); System.out.println(generatedFloat);
} }
@Test
public void givenUsingApache_whenGeneratingRandomFloatUnbounded_thenCorrect() {
final float generatedFloat = new RandomDataGenerator().getRandomGenerator().nextFloat();
System.out.println(generatedFloat);
}
@Test @Test
public void givenUsingPlainJava_whenGeneratingRandomFloatBouned_thenCorrect() { public void givenUsingPlainJava_whenGeneratingRandomFloatBouned_thenCorrect() {
final float leftLimit = 1F; final float leftLimit = 1F;