// Path: src/main/java/com/github/brunodles/javavalidation/ValidationResult.java
// public interface ValidationResult {
//     /**
//      * This is the return of the whole tests.
//      *
//      * @return true if didn't found any error
//      */
//     boolean isValid();
// 
// 
//     /**
//      * With this you can check if one key have certain error.
//      *
//      * @param key   normaly is used the field name
//      * @param error the error from {@link Errors}
//      * @return true if the key contains the error
//      */
//     boolean contains(String key, int error);
// 
//     /**
//      * With this you can check if the key have a error
//      *
//      * @param key normaly is used the field name
//      * @return true if the key contains a error
//      */
//     boolean contains(String key);
// 
//     /**
//      * All keys that have errors
//      *
//      * @return a list with all keys
//      */
//     List<String> keys();
// }
// 
// Path: src/main/java/com/github/brunodles/javavalidation/ValidationResultBuilder.java
// public class ValidationResultBuilder implements ValidationResult {
//     HashMap<String, Integer> errorMap;
// 
//     public ValidationResultBuilder() {
//         errorMap = new HashMap<>();
//     }
// 
//     /**
//      * Use this method to add an error.
//      *
//      * @param key   This key will be used to know what is wrong, you ca use the field name here.
//      * @param error All errors are constants, use one of {@link Errors}
//      */
//     public void add(String key, int error) {
//         Integer errors = errorsFrom(key);
//         errors |= error;
//         errorMap.put(key, errors);
//     }
// 
//     /**
//      * This will return one error adder for the key
//      *
//      * @param key the key you want to add error
//      * @return a {@link IntConsumer}, to add errors on the key just call {@link IntConsumer#accept(int)}
//      */
//     public IntConsumer adder(String key) {
//         return error -> add(key, error);
//     }
// 
//     /**
//      * With this method you can get the errors from one key
//      *
//      * @param key
//      * @return
//      */
//     private Integer errorsFrom(String key) {
//         Integer errors = errorMap.get(key);
//         if (errors == null) errors = 0;
//         return errors;
//     }
// 
//     /**
//      * Check if the object is valid
//      *
//      * @return true if the object don't have any error
//      */
//     public boolean isValid() {
//         return errorMap.isEmpty();
//     }
// 
//     /**
//      * With this you can check if one key have certain error.
//      *
//      * @param key   the same key used on {@link #add}
//      * @param error the error from {@link Errors}
//      * @return true if the key contains the error
//      */
//     @Override
//     public boolean contains(String key, int error) {
//         Integer errors = errorsFrom(key);
//         return (errors & error) == error;
//     }
// 
//     @Override
//     public boolean contains(String key) {
//         return errorsFrom(key) != 0;
//     }
// 
//     @Override
//     public List<String> keys() {
//         return Collections.unmodifiableList(new ArrayList<>(errorMap.keySet()));
//     }
// 
//     /**
//      * With this you can use a builder to create all errors for one key
//      *
//      * @param key the key where the errors will be added
//      * @return a helper to build the errors {@link When}
//      */
//     public When addTo(String key) {
//         return new When(adder(key));
//     }
// }
// 
// Path: src/main/java/com/github/brunodles/javavalidation/ValidatorBase.java
// public abstract class ValidatorBase<T> implements Validator<T> {
// 
//     public ValidationResult validate(T object) {
//         ValidationResultBuilder resultBuilder = new ValidationResultBuilder();
//         validate(object, resultBuilder);
//         return resultBuilder;
//     }
// 
//     protected abstract void validate(T object, ValidationResultBuilder resultBuilder);
// }
// 
// Path: src/main/java/com/github/brunodles/javavalidation/Errors.java
// public class Errors {
//     // Object
//     public static final int NULL = 1;
//     public static final int EQUAL = 2;
// 
//     // Boolean
//     public static final int FALSE = 4;
//     public static final int TRUE = 8;
// 
//     // String
//     public static final int EMPTY = 16;
// 
//     // Integer
//     public static final int GREATER = 32;
//     public static final int LOWER = 64;
//     public static final int BETWEEN = 128;
// }


import com.github.brunodles.javavalidation.ValidationResult;
import com.github.brunodles.javavalidation.ValidationResultBuilder;
import com.github.brunodles.javavalidation.ValidatorBase;
import com.mscharhag.oleaster.runner.OleasterRunner;
import org.junit.runner.RunWith;
import static com.github.brunodles.javavalidation.Errors.*;
import static com.mscharhag.oleaster.matcher.Matchers.expect;
import static com.mscharhag.oleaster.runner.StaticRunnerSupport.*;


/**
 * Created by bruno on 03/06/16.
 */
@RunWith(OleasterRunner.class)
public class MainTest {

    private SampleValidator validator;

// Path: src/main/java/com/github/brunodles/javavalidation/ValidationResult.java
// public interface ValidationResult {
//     /**
//      * This is the return of the whole tests.
//      *
//      * @return true if didn't found any error
//      */
//     boolean isValid();
// 
// 
//     /**
//      * With this you can check if one key have certain error.
//      *
//      * @param key   normaly is used the field name
//      * @param error the error from {@link Errors}
//      * @return true if the key contains the error
//      */
//     boolean contains(String key, int error);
// 
//     /**
//      * With this you can check if the key have a error
//      *
//      * @param key normaly is used the field name
//      * @return true if the key contains a error
//      */
//     boolean contains(String key);
// 
//     /**
//      * All keys that have errors
//      *
//      * @return a list with all keys
//      */
//     List<String> keys();
// }
// 
// Path: src/main/java/com/github/brunodles/javavalidation/ValidationResultBuilder.java
// public class ValidationResultBuilder implements ValidationResult {
//     HashMap<String, Integer> errorMap;
// 
//     public ValidationResultBuilder() {
//         errorMap = new HashMap<>();
//     }
// 
//     /**
//      * Use this method to add an error.
//      *
//      * @param key   This key will be used to know what is wrong, you ca use the field name here.
//      * @param error All errors are constants, use one of {@link Errors}
//      */
//     public void add(String key, int error) {
//         Integer errors = errorsFrom(key);
//         errors |= error;
//         errorMap.put(key, errors);
//     }
// 
//     /**
//      * This will return one error adder for the key
//      *
//      * @param key the key you want to add error
//      * @return a {@link IntConsumer}, to add errors on the key just call {@link IntConsumer#accept(int)}
//      */
//     public IntConsumer adder(String key) {
//         return error -> add(key, error);
//     }
// 
//     /**
//      * With this method you can get the errors from one key
//      *
//      * @param key
//      * @return
//      */
//     private Integer errorsFrom(String key) {
//         Integer errors = errorMap.get(key);
//         if (errors == null) errors = 0;
//         return errors;
//     }
// 
//     /**
//      * Check if the object is valid
//      *
//      * @return true if the object don't have any error
//      */
//     public boolean isValid() {
//         return errorMap.isEmpty();
//     }
// 
//     /**
//      * With this you can check if one key have certain error.
//      *
//      * @param key   the same key used on {@link #add}
//      * @param error the error from {@link Errors}
//      * @return true if the key contains the error
//      */
//     @Override
//     public boolean contains(String key, int error) {
//         Integer errors = errorsFrom(key);
//         return (errors & error) == error;
//     }
// 
//     @Override
//     public boolean contains(String key) {
//         return errorsFrom(key) != 0;
//     }
// 
//     @Override
//     public List<String> keys() {
//         return Collections.unmodifiableList(new ArrayList<>(errorMap.keySet()));
//     }
// 
//     /**
//      * With this you can use a builder to create all errors for one key
//      *
//      * @param key the key where the errors will be added
//      * @return a helper to build the errors {@link When}
//      */
//     public When addTo(String key) {
//         return new When(adder(key));
//     }
// }
// 
// Path: src/main/java/com/github/brunodles/javavalidation/ValidatorBase.java
// public abstract class ValidatorBase<T> implements Validator<T> {
// 
//     public ValidationResult validate(T object) {
//         ValidationResultBuilder resultBuilder = new ValidationResultBuilder();
//         validate(object, resultBuilder);
//         return resultBuilder;
//     }
// 
//     protected abstract void validate(T object, ValidationResultBuilder resultBuilder);
// }
// 
// Path: src/main/java/com/github/brunodles/javavalidation/Errors.java
// public class Errors {
//     // Object
//     public static final int NULL = 1;
//     public static final int EQUAL = 2;
// 
//     // Boolean
//     public static final int FALSE = 4;
//     public static final int TRUE = 8;
// 
//     // String
//     public static final int EMPTY = 16;
// 
//     // Integer
//     public static final int GREATER = 32;
//     public static final int LOWER = 64;
//     public static final int BETWEEN = 128;
// }


// Path: src/test/java/MainTest.java
import com.github.brunodles.javavalidation.ValidationResult;
import com.github.brunodles.javavalidation.ValidationResultBuilder;
import com.github.brunodles.javavalidation.ValidatorBase;
import com.mscharhag.oleaster.runner.OleasterRunner;
import org.junit.runner.RunWith;
import static com.github.brunodles.javavalidation.Errors.*;
import static com.mscharhag.oleaster.matcher.Matchers.expect;
import static com.mscharhag.oleaster.runner.StaticRunnerSupport.*;



/**
 * Created by bruno on 03/06/16.
 */
@RunWith(OleasterRunner.class)
public class MainTest {

    private SampleValidator validator;

    private ValidationResult validation;