@Test void goodCamelCaseShouldReturnTrue() { String goodCamelCase1 = "myVariable"; String goodCamelCase2 = "variable"; String goodCamelCase3 = "mySuperVariable"; String goodCamelCase4 = "mySuperVariableIsAFunnyOne"; String goodCamelCase5 = "zone2Delete"; String goodCamelCase6 = "address1"; boolean actual1 = validator.isNamingValid(goodCamelCase1, ValidatorParameters.NamingConvention.CamelCase); boolean actual2 = validator.isNamingValid(goodCamelCase2, ValidatorParameters.NamingConvention.CamelCase); boolean actual3 = validator.isNamingValid(goodCamelCase3, ValidatorParameters.NamingConvention.CamelCase); boolean actual4 = validator.isNamingValid(goodCamelCase4, ValidatorParameters.NamingConvention.CamelCase); boolean actual5 = validator.isNamingValid(goodCamelCase5, ValidatorParameters.NamingConvention.CamelCase); boolean actual6 = validator.isNamingValid(goodCamelCase6, ValidatorParameters.NamingConvention.CamelCase); Assertions.assertAll( () -> assertTrue(actual1), () -> assertTrue(actual2), () -> assertTrue(actual3), () -> assertTrue(actual4), () -> assertTrue(actual5), () -> assertTrue(actual6) ); }
boolean isNamingValid(String name, ValidatorParameters.NamingConvention namingStrategy) { switch (namingStrategy) { case UnderscoreCase: return isUnderscoreCase(name); case CamelCase: return isCamelCase(name); case HyphenCase: return isHyphenCase(name); } return false; }
NamingValidator { boolean isNamingValid(String name, ValidatorParameters.NamingConvention namingStrategy) { switch (namingStrategy) { case UnderscoreCase: return isUnderscoreCase(name); case CamelCase: return isCamelCase(name); case HyphenCase: return isHyphenCase(name); } return false; } }
NamingValidator { boolean isNamingValid(String name, ValidatorParameters.NamingConvention namingStrategy) { switch (namingStrategy) { case UnderscoreCase: return isUnderscoreCase(name); case CamelCase: return isCamelCase(name); case HyphenCase: return isHyphenCase(name); } return false; }  }
NamingValidator { boolean isNamingValid(String name, ValidatorParameters.NamingConvention namingStrategy) { switch (namingStrategy) { case UnderscoreCase: return isUnderscoreCase(name); case CamelCase: return isCamelCase(name); case HyphenCase: return isHyphenCase(name); } return false; }   }
NamingValidator { boolean isNamingValid(String name, ValidatorParameters.NamingConvention namingStrategy) { switch (namingStrategy) { case UnderscoreCase: return isUnderscoreCase(name); case CamelCase: return isCamelCase(name); case HyphenCase: return isHyphenCase(name); } return false; }    }