@Test void goodHyphenCaseShouldReturnTrue() { String goodHyphenCase1 = "my-variable"; String goodHyphenCase2 = "variable"; String goodHyphenCase3 = "my-super-variable"; boolean actual1 = validator.isNamingValid(goodHyphenCase1, ValidatorParameters.NamingConvention.HyphenCase); boolean actual2 = validator.isNamingValid(goodHyphenCase2, ValidatorParameters.NamingConvention.HyphenCase); boolean actual3 = validator.isNamingValid(goodHyphenCase3, ValidatorParameters.NamingConvention.HyphenCase); Assertions.assertAll( () -> assertTrue(actual1), () -> assertTrue(actual2), () -> assertTrue(actual3) ); }
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; }    }