Package unit.validation

Source Code of unit.validation.MinSizeValidationTest

package unit.validation;

import litmus.Builder;
import litmus.unit.validation.ValidationTest;
import models.MinSizeModel;
import org.junit.Test;

public class MinSizeValidationTest extends ValidationTest<MinSizeModel> {

    @Override
    protected Builder<MinSizeModel> valid() {
        return new MinSizeModelBuilder();

    }

    @Test
    public void minString() {
        assertThat("minString").withValue(null).isValid();
        assertThat("minString").withValue("").isValid();
        assertThat("minString").mustNotHaveSizeSmallerThan(4);
    }

    private class MinSizeModelBuilder extends Builder<MinSizeModel> {
        @Override
        public MinSizeModel build() {
            MinSizeModel model = new MinSizeModel();
            model.minString = "String longer than 4 characters";
            return model;
        }
    }
}
TOP

Related Classes of unit.validation.MinSizeValidationTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.