package au.com.anthonybruno.generator;

import au.com.anthonybruno.generator.defaults.StringGenerator;
import org.junit.Test;

import java.util.HashSet;
import java.util.Set;

import static junit.framework.TestCase.assertTrue;

public class PrimitiveGeneratorsTest {

    @Test
    public void stringGeneration() {
        StringGenerator generator = new StringGenerator();
        int numValues = 10000;
        Set<String> set = new HashSet<>();

        for (int i = 0; i < numValues; i++) {
            String value = generator.generate();
            set.add(value);
        }

        assertTrue(set.size() >= 9500); //ensure most values generated are random
    }
}

@@ -33,16 +33,80 @@
 rator;%0A%0A
+import au.com.anthonybruno.generator.defaults.BooleanGenerator;%0A
 import a
@@ -156,24 +156,24 @@
 gGenerator;%0A
-
 import org.j
@@ -460,16 +460,17 @@
  = 10000
+0
 ;%0A      
@@ -674,14 +674,32 @@
 ze()
+ + %22%22, set.size()
  %3E= 9
-5
+00
 00);
@@ -746,11 +746,532 @@
 om%0A    %7D
+%0A%0A    @Test%0A    public void booleanGenerator() %7B%0A        BooleanGenerator generator = new BooleanGenerator();%0A        int numValues = 100000;%0A%0A        int trueValues = 0;%0A        int falseValues = 0;%0A        for (int i = 0; i %3C numValues; i++) %7B%0A            boolean value = generator.generate();%0A            if (value) %7B%0A                trueValues++;%0A            %7D else %7B%0A                falseValues++;%0A            %7D%0A        %7D%0A        int diff = Math.abs(trueValues - falseValues);%0A%0A        assertTrue(diff %3C 500);%0A%0A    %7D
 %0A%7D%0A

Add boolean generation