public void UnderscoreTolerantCamelCaseWithUpperStart() { var rule = new NamingRule(AffectedEntity.Class); rule.NamingStyle = NamingStyle.CamelCaseWithUpperLetterUnderscore; Assert.IsFalse(rule.IsValid("PascalCase")); Assert.IsFalse(rule.IsValid("camelCase_underscoreTolerant")); Assert.IsFalse(rule.IsValid("camelCase__UnderscoreTolerant")); Assert.IsTrue(rule.IsValid("camelCase_UnderscoreTolerant")); }
public void TestFirstUpper() { var rule = new NamingRule(AffectedEntity.Class); rule.NamingStyle = NamingStyle.FirstUpper; Assert.IsFalse(rule.IsValid("PascalCase")); Assert.IsFalse(rule.IsValid("camelCase")); Assert.IsTrue(rule.IsValid("First_upper")); Assert.IsTrue(rule.IsValid("Firstupper")); }
public void TestAllLower() { var rule = new NamingRule(AffectedEntity.Class); rule.NamingStyle = NamingStyle.AllLower; Assert.IsFalse(rule.IsValid("PascalCase")); Assert.IsFalse(rule.IsValid("camelCase")); Assert.IsTrue(rule.IsValid("all_lower")); Assert.IsTrue(rule.IsValid("alllower")); }
public void TestAllUpper() { var rule = new NamingRule(AffectedEntity.Class); rule.NamingStyle = NamingStyle.AllUpper; Assert.IsFalse(rule.IsValid("PascalCase")); Assert.IsFalse(rule.IsValid("camelCase")); Assert.IsTrue(rule.IsValid("ALL_UPPER")); Assert.IsTrue(rule.IsValid("ALLUPPER")); }
public void TestCamelCase() { var rule = new NamingRule(AffectedEntity.Class); rule.NamingStyle = NamingStyle.CamelCase; Assert.IsFalse(rule.IsValid("PascalCase")); Assert.IsFalse(rule.IsValid("camel_Case")); Assert.IsTrue(rule.IsValid("camelCase")); Assert.IsTrue(rule.IsValid("camelCase_10_11")); }