Esempio n. 1
0
        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"));
        }
Esempio n. 2
0
        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"));
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        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"));
        }
Esempio n. 5
0
        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"));
        }
		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"));
		}