// Path: datagen/src/main/java/io/qala/datagen/RandomShortApi.java
// public static String unicode(int exactLength) {
//     return length(exactLength).unicode();
// }


import org.junit.Test;
import static io.qala.datagen.RandomShortApi.unicode;
package io.qala.datagen.examples;



public class _05_MaxBoundaryValidationTest {
    private Db db = new Db();

    @Test public void usernameValidation_passesForMaxBoundary_inTraditionalApproach() {
        db.save(new Person("ABCDEFGHIJАБВГДИЙКЛм"));
    }

    @Test(expected = IllegalStateException.class)
    public void usernameValidation_failsForMaxBoundary_ifRandomized() {//will fail once in a million cases
// Path: datagen/src/main/java/io/qala/datagen/RandomShortApi.java
// public static String unicode(int exactLength) {
//     return length(exactLength).unicode();
// }


// Path: examples/src/test/java/io/qala/datagen/examples/_05_MaxBoundaryValidationTest.java
import org.junit.Test;
import static io.qala.datagen.RandomShortApi.unicode;

package io.qala.datagen.examples;



public class _05_MaxBoundaryValidationTest {
    private Db db = new Db();

    @Test public void usernameValidation_passesForMaxBoundary_inTraditionalApproach() {
        db.save(new Person("ABCDEFGHIJАБВГДИЙКЛм"));
    }

    @Test(expected = IllegalStateException.class)
    public void usernameValidation_failsForMaxBoundary_ifRandomized() {//will fail once in a million cases
        db.save(new Person(unicode(20)));