* Test of validateName method, of class WordPressDirectoryNameValidator.
*/
@Test
public void testValidateName() {
// invalid
ValidationResult result = new WordPressDirectoryNameValidator()
.validateName(null)
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("@")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName(" ")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("/")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("?")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("<")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName(">")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("!")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("\"")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("#")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("$")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("%")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("&")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("'")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("(")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName(")")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("=")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("~")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("|")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("\\")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("^")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("`")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("{")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("}")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("[")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("]")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("+")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("*")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName(";")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName(":")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName(",")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("あ")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("日本語")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("ア")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("A")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("test/")
.getResult();
Assert.assertTrue(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
// valid
result = new WordPressDirectoryNameValidator()
.validateName("a")
.getResult();
Assert.assertFalse(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("A")
.getResult();
Assert.assertFalse(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("-")
.getResult();
Assert.assertFalse(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName(".")
.getResult();
Assert.assertFalse(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("_")
.getResult();
Assert.assertFalse(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
result = new WordPressDirectoryNameValidator()
.validateName("test-child")
.getResult();
Assert.assertFalse(result.hasWarnings());
Assert.assertFalse(result.hasErrors());
}