// Path: src/main/java/pl/domzal/junit/docker/rule/ex/InvalidParameter.java
// public class InvalidParameter extends IllegalStateException {
// 
//     public InvalidParameter(String message) {
//         super(message);
//     }
// 
// }


import org.junit.Test;
import org.junit.experimental.categories.Category;
import pl.domzal.junit.docker.rule.ex.InvalidParameter;
package pl.domzal.junit.docker.rule;



@Category(test.category.Stable.class)
public class NameValidatorTest {

    @Test(expected = InvalidParameter.class)
    public void failNull() {
        LinkNameValidator.validateContainerName(null);
    }

    @Test(expected = InvalidParameter.class)
    public void failEmpty() {
        LinkNameValidator.validateContainerName("");
    }

    @Test(expected = InvalidParameter.class)
    public void failInvalidCharsInName1() {
        LinkNameValidator.validateContainerName("host%");
    }

    @Test(expected = InvalidParameter.class)
    public void failInvalidCharsInName2() {
        LinkNameValidator.validateContainerName("host:");
    }

    @Test
    public void okValidName() {
// Path: src/main/java/pl/domzal/junit/docker/rule/ex/InvalidParameter.java
// public class InvalidParameter extends IllegalStateException {
// 
//     public InvalidParameter(String message) {
//         super(message);
//     }
// 
// }


// Path: src/test/java/pl/domzal/junit/docker/rule/NameValidatorTest.java
import org.junit.Test;
import org.junit.experimental.categories.Category;
import pl.domzal.junit.docker.rule.ex.InvalidParameter;

package pl.domzal.junit.docker.rule;



@Category(test.category.Stable.class)
public class NameValidatorTest {

    @Test(expected = InvalidParameter.class)
    public void failNull() {
        LinkNameValidator.validateContainerName(null);
    }

    @Test(expected = InvalidParameter.class)
    public void failEmpty() {
        LinkNameValidator.validateContainerName("");
    }

    @Test(expected = InvalidParameter.class)
    public void failInvalidCharsInName1() {
        LinkNameValidator.validateContainerName("host%");
    }

    @Test(expected = InvalidParameter.class)
    public void failInvalidCharsInName2() {
        LinkNameValidator.validateContainerName("host:");
    }

    @Test
    public void okValidName() {
        LinkNameValidator.validateContainerName("abcDEF_-");