コード例 #1
0
        public async Task TemplateEngineShouldUseSameNamingConventionForBinding()
        {
            var cacheProvider  = new MemoryCacheProvider();
            var handlerFactory = new Mock <IHelperHandlerFactory>();

            handlerFactory.Setup(f => f.Create()).Returns(Enumerable.Empty <IHelperHandler>());

            var          namingRule     = new NamingRule();
            var          schemaProvider = new HandlebarsViewSchemaProvider(null, new MemberLocatorFromNamingRule(namingRule));
            var          codeGenerator  = new JsonSchemaCodeGenerator(namingRule);
            const string input          = "<p>{{name}}</p><p>{{first_name}}</p>";
            var          templateInfo   = new StringTemplateInfo("views/test", input);

            var schema = await schemaProvider.GetSchemaFromTemplateAsync(templateInfo).ConfigureAwait(false);

            var modelType = codeGenerator.Compile(schema);

            var viewEngine = new VeilViewEngine(cacheProvider, handlerFactory.Object, namingRule);

            var view = await viewEngine.CreateViewAsync(templateInfo, modelType).ConfigureAwait(false);

            var model = Activator.CreateInstance(modelType);

            modelType.GetProperty("Name").SetValue(model, "{{name}}");
            modelType.GetProperty("FirstName").SetValue(model, "{{first_name}}");

            var writer = new StringWriter();

            view.Render(model, new RenderingContext(writer));
            var stringResult = writer.ToString();

            Assert.AreEqual(input, stringResult);
        }
コード例 #2
0
        public bool TableExists(IDataContext db, string tableName)
        {
            if (db == null)
            {
                throw new ArgumentNullException("session");
            }

            if (tableName == null)
            {
                throw new ArgumentNullException("tableName");
            }

            if (!NamingRule.IsValidSqlName(tableName))
            {
                throw new ArgumentOutOfRangeException("tableName");
            }

            //检查连接
            var sql = new SqlString(
                "select coalesce(count(table_name), 0) ",
                "from information_schema.tables ",
                "where table_type='BASE TABLE' and table_schema='dbo' and table_name=",
                Parameter.Placeholder);

            var n = Convert.ToInt32(db.QueryValue(sql, tableName));

            return(n > 0);
        }
コード例 #3
0
        public void CreateTable(IDataContext db, string tableName, string label)
        {
            if (db == null)
            {
                throw new ArgumentNullException("session");
            }

            if (string.IsNullOrEmpty(tableName))
            {
                throw new ArgumentNullException("tableName");
            }

            if (!NamingRule.IsValidSqlName(tableName))
            {
                throw new ArgumentOutOfRangeException("tableName");
            }

            LoggerProvider.EnvironmentLogger.Debug(String.Format("Creating Table [{0}]...", tableName));

            tableName = tableName.SqlEscape();
            var sb = new SqlStringBuilder();

            sb.Add("create table [");
            sb.Add(tableName);
            sb.Add("] (");
            sb.Add("[_id] bigint not null identity(1,1), ");
            sb.Add("primary key([_id]))");

            var sql = sb.ToSqlString();

            db.Execute(sql);

            //TODO
            // SetTableComment(db, tableName, label);
        }
コード例 #4
0
        public void AddFK(IDataContext db, string columnName, string refTable, OnDeleteAction act)
        {
            if (db == null)
            {
                throw new ArgumentNullException("session");
            }
            if (string.IsNullOrEmpty(columnName))
            {
                throw new ArgumentNullException("columnName");
            }
            if (!NamingRule.IsValidSqlName(columnName))
            {
                throw new ArgumentOutOfRangeException("columnName");
            }
            if (string.IsNullOrEmpty(refTable))
            {
                throw new ArgumentNullException("refTable");
            }

            var onDelete = OnDeleteMapping[act];
            var fkName   = this.GenerateFkName(columnName);
            var sql      = string.Format(CultureInfo.InvariantCulture,
                                         "alter table [{0}] add constraint [{1}] foreign key ([{2}]) references [{3}] on delete {4}",
                                         this.Name, fkName, columnName, refTable, onDelete);

            db.Execute(SqlString.Parse(sql));
        }
コード例 #5
0
        private void LoadColumns(IDataContext db, string tableName)
        {
            if (db == null)
            {
                throw new ArgumentNullException("session");
            }
            if (string.IsNullOrEmpty(tableName))
            {
                throw new ArgumentNullException("tableName");
            }
            if (!NamingRule.IsValidSqlName(tableName))
            {
                throw new ArgumentOutOfRangeException("tableName");
            }

            var sql = new SqlString(
                "select column_name, data_type, is_nullable, character_maximum_length ",
                "from information_schema.columns ",
                "where table_name=", Parameter.Placeholder, " ",
                "order by ordinal_position");

            var records = db.QueryAsDictionary(sql, tableName);

            this.columns.Clear();
            foreach (var r in records)
            {
                var column = new MssqlColumnMetadata(r);
                this.columns.Add(column.Name, column);
            }
        }
コード例 #6
0
        public void AlterColumnNullable(IDataContext db, string columnName, bool nullable)
        {
            if (db == null)
            {
                throw new ArgumentNullException("session");
            }

            if (string.IsNullOrEmpty(columnName))
            {
                throw new ArgumentNullException("columnName");
            }

            if (!NamingRule.IsValidSqlName(columnName))
            {
                throw new ArgumentOutOfRangeException("columnName");
            }

            //TODO
            //DO nothing

            /*
             * var sql = string.Format(CultureInfo.InvariantCulture,
             *  "alter table [{0}] alter column [{1}] {2}",
             *  this.Name, columnName, sqlType);
             * db.Execute(SqlString.Parse(sql));
             */
        }
コード例 #7
0
 private State(TService service, SemanticDocument document, NamingRule fieldNamingRule, NamingRule propertyNamingRule, NamingRule parameterNamingRule)
 {
     _service             = service;
     _document            = document;
     _fieldNamingRule     = fieldNamingRule;
     _propertyNamingRule  = propertyNamingRule;
     _parameterNamingRule = parameterNamingRule;
 }
コード例 #8
0
        public void TestCase70925()
        {
            var rule = new NamingRule(AffectedEntity.Field);

            rule.NamingStyle = NamingStyle.PascalCase;
            System.Collections.Generic.IList <string> suggestedNames;
            rule.GetErrorMessage(new TestRefactoringContext(null, TextLocation.Empty, null), "_taskStatus", out suggestedNames);
            Assert.IsTrue(suggestedNames.Contains("TaskStatus"));
        }
コード例 #9
0
        public void TestSuggestionForPascalCase()
        {
            var rule = new NamingRule(AffectedEntity.Class);

            rule.NamingStyle = NamingStyle.PascalCase;
            System.Collections.Generic.IList <string> suggestedNames;
            rule.GetErrorMessage(new TestRefactoringContext(null, TextLocation.Empty, null), "pascalCase_12_____12323", out suggestedNames);
            Assert.IsTrue(suggestedNames.Contains("PascalCase_12_12323"));
        }
コード例 #10
0
        public void TestSuggestionForPascalCaseWithLowerStart()
        {
            var rule = new NamingRule(AffectedEntity.Class);

            rule.NamingStyle = NamingStyle.PascalCaseWithLowerLetterUnderscore;
            System.Collections.Generic.IList <string> suggestedNames;
            rule.GetErrorMessage(new TestRefactoringContext(null, TextLocation.Empty, null), "PascalCase_UnderscoreTolerant", out suggestedNames);
            Assert.IsTrue(suggestedNames.Contains("PascalCase_underscoreTolerant"));
        }
コード例 #11
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"));
        }
コード例 #12
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"));
        }
コード例 #13
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"));
        }
コード例 #14
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"));
        }
コード例 #15
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"));
        }
コード例 #16
0
            private State(TService service, SemanticDocument document, NamingRule fieldNamingRule, NamingRule propertyNamingRule, NamingRule parameterNamingRule)
            {
                _service             = service;
                _document            = document;
                _fieldNamingRule     = fieldNamingRule;
                _propertyNamingRule  = propertyNamingRule;
                _parameterNamingRule = parameterNamingRule;

                ParameterToNewFieldMap    = ImmutableDictionary <string, string> .Empty;
                ParameterToNewPropertyMap = ImmutableDictionary <string, string> .Empty;
            }
コード例 #17
0
            private State(TService service, SemanticDocument document, NamingRule fieldNamingRule, NamingRule propertyNamingRule, NamingRule parameterNamingRule, CodeAndImportGenerationOptionsProvider fallbackOptions)
            {
                _service             = service;
                _document            = document;
                _fieldNamingRule     = fieldNamingRule;
                _propertyNamingRule  = propertyNamingRule;
                _parameterNamingRule = parameterNamingRule;

                ParameterToNewFieldMap    = ImmutableDictionary <string, string> .Empty;
                ParameterToNewPropertyMap = ImmutableDictionary <string, string> .Empty;
                _fallbackOptions          = fallbackOptions;
            }
コード例 #18
0
 public NamingStyleSetting(
     NamingRule namingRule,
     NamingStyle[] allStyles,
     NamingStyleSettingsUpdater settingsUpdater,
     string?fileName = null)
 {
     Style            = namingRule.NamingStyle;
     _allStyles       = allStyles;
     Type             = namingRule.SymbolSpecification;
     Severity         = namingRule.EnforcementLevel;
     _settingsUpdater = settingsUpdater;
     Location         = new SettingLocation(fileName is null ? LocationKind.VisualStudio : LocationKind.EditorConfig, fileName);
 }
コード例 #19
0
            private string GetEventHandlerName(
                IEventSymbol eventSymbol, SyntaxToken plusEqualsToken, SemanticModel semanticModel,
                ISyntaxFactsService syntaxFactsService, NamingRule namingRule)
            {
                AssertIsBackground();
                var objectPart = GetNameObjectPart(eventSymbol, plusEqualsToken, semanticModel, syntaxFactsService);
                var basename = namingRule.NamingStyle.CreateName(ImmutableArray.Create(
                    string.Format("{0}_{1}", objectPart, eventSymbol.Name)));

                var reservedNames = semanticModel.LookupSymbols(plusEqualsToken.SpanStart).Select(m => m.Name);

                return NameGenerator.EnsureUniqueness(basename, reservedNames);
            }
コード例 #20
0
        private string GenerateFkName(string columnName)
        {
            if (string.IsNullOrEmpty(columnName))
            {
                throw new ArgumentNullException("columnName");
            }
            if (!NamingRule.IsValidSqlName(columnName))
            {
                throw new ArgumentOutOfRangeException("columnName");
            }

            return(string.Format(CultureInfo.InvariantCulture, "{0}_{1}_fkey", this.Name, columnName));
        }
コード例 #21
0
        public IColumnMetadata GetColumn(string columnName)
        {
            if (string.IsNullOrEmpty(columnName))
            {
                throw new ArgumentNullException("columnName");
            }

            if (!NamingRule.IsValidSqlName(columnName))
            {
                throw new ArgumentOutOfRangeException("columnName");
            }

            return(this.columns[columnName]);
        }
コード例 #22
0
        public bool ColumnExists(string columnName)
        {
            if (string.IsNullOrEmpty(columnName))
            {
                throw new ArgumentNullException("columnName");
            }

            if (!NamingRule.IsValidSqlName(columnName))
            {
                throw new ArgumentOutOfRangeException("columnName");
            }

            return(this.columns.ContainsKey(columnName));
        }
コード例 #23
0
        public ParameterName(string nameBasedOnArgument, bool isFixed, NamingRule parameterNamingRule)
        {
            NameBasedOnArgument = nameBasedOnArgument;

            if (isFixed)
            {
                // If the parameter name is fixed, we have to accept it as is.
                BestNameForParameter = NameBasedOnArgument;
            }
            else
            {
                // Otherwise, massage it a bit to be a more suitable match for
                // how people actually writing parameters.
                BestNameForParameter = parameterNamingRule.NamingStyle.MakeCompliant(nameBasedOnArgument).First();
            }
        }
コード例 #24
0
ファイル: ParameterName.cs プロジェクト: zhouweiaccp/roslyn
        public ParameterName(string nameBasedOnArgument, bool isFixed, NamingRule parameterNamingRule)
        {
            NameBasedOnArgument = nameBasedOnArgument;

            if (isFixed)
            {
                // If the parameter name is fixed, we have to accept it as is.
                BestNameForParameter = NameBasedOnArgument;
            }
            else
            {
                // Otherwise, massage it a bit to be a more suitable match for
                // how people actually writing parameters.
                var trimmed = nameBasedOnArgument.TrimStart('_');
                BestNameForParameter = trimmed.Length > 0 ? trimmed.ToCamelCase() : nameBasedOnArgument;
                BestNameForParameter = parameterNamingRule.NamingStyle.MakeCompliant(BestNameForParameter).First();
            }
        }
コード例 #25
0
        public static ImmutableArray <ParameterName> GenerateParameterNames(
            this SemanticModel semanticModel,
            IEnumerable <ArgumentSyntax> arguments,
            IList <string> reservedNames,
            NamingRule parameterNamingRule,
            CancellationToken cancellationToken)
        {
            reservedNames ??= SpecializedCollections.EmptyList <string>();

            // We can't change the names of named parameters.  Any other names we're flexible on.
            var isFixed = reservedNames.Select(s => true).Concat(
                arguments.Select(a => a.NameColon != null)).ToImmutableArray();

            var parameterNames = reservedNames.Concat(
                arguments.Select(a => semanticModel.GenerateNameForArgument(a, cancellationToken))).ToImmutableArray();

            return(GenerateNames(reservedNames, isFixed, parameterNames, parameterNamingRule));
        }
コード例 #26
0
        private async Task <string> ExecuteServerSide(string testName, string templateFile, string dataFile)
        {
            var cacheProvider  = new NullCacheProvider();
            var namingRule     = new NamingRule();
            var handlerFactory = new NullRenderingHelperHandlerFactory();
            var config         = ConfigurationLoader.LoadNitroConfiguration(Path.Combine(TestContext.DeploymentDirectory, "Basic"));

            var templateInfo = new FileTemplateInfo(testName, TemplateType.View, PathInfo.Create(templateFile), new FileSystem(config));

            var   viewEngine = new VeilViewEngine(cacheProvider, handlerFactory, namingRule);
            IView view       = await viewEngine.CreateViewAsync(templateInfo).ConfigureAwait(false);

            if (view == null)
            {
                Assert.Fail("Could not create view from file'{0}'.", templateFile);
            }

            object model;

            using (var reader = new StreamReader(dataFile))
            {
                model = new JsonSerializer().Deserialize(reader, typeof(Dictionary <string, object>));
            }

            if (TestContext.Properties.Contains("$LoadTestUserContext"))
            {
                this.TestContext.BeginTimer("Server");
            }

            var builder = new StringBuilder();

            using (var writer = new StringWriterDelayed(builder))
            {
                view.Render(model, new RenderingContext(writer));
            }
            var resultString = builder.ToString();

            if (TestContext.Properties.Contains("$LoadTestUserContext"))
            {
                this.TestContext.EndTimer("Server");
            }

            return(resultString);
        }
コード例 #27
0
        private ImmutableArray <ParameterName> GenerateParameterNames(
            SemanticDocument document,
            IEnumerable <Argument> arguments,
            IList <string> reservedNames,
            NamingRule parameterNamingRule,
            CancellationToken cancellationToken
            )
        {
            reservedNames ??= SpecializedCollections.EmptyList <string>();

            // We can't change the names of named parameters.  Any other names we're flexible on.
            var isFixed = reservedNames
                          .Select(s => true)
                          .Concat(arguments.Select(a => a.IsNamed))
                          .ToImmutableArray();

            var parameterNames = reservedNames
                                 .Concat(
                arguments.Select(
                    a =>
                    this.GenerateNameForArgument(
                        document.SemanticModel,
                        a,
                        cancellationToken
                        )
                    )
                )
                                 .ToImmutableArray();

            var syntaxFacts = document.Document.GetRequiredLanguageService <ISyntaxFactsService>();
            var comparer    = syntaxFacts.StringComparer;

            return(NameGenerator
                   .EnsureUniqueness(
                       parameterNames,
                       isFixed,
                       canUse: s => !reservedNames.Any(n => comparer.Equals(s, n))
                       )
                   .Select(
                       (name, index) => new ParameterName(name, isFixed[index], parameterNamingRule)
                       )
                   .Skip(reservedNames.Count)
                   .ToImmutableArray());
        }
コード例 #28
0
        public void TestClassNameNormalization()
        {
            var inputs = new List <Tuple <string, string> >
            {
                new Tuple <string, string>(null, null),
                new Tuple <string, string>("class", "Class"),
                new Tuple <string, string>("person info", "PersonInfo"),
                new Tuple <string, string>("person", "Person"),
                new Tuple <string, string>("Person", "Person"),
                new Tuple <string, string>("person_info", "PersonInfo"),
                new Tuple <string, string>("SimpleClass", "SimpleClass"),
            };

            foreach (var input in inputs)
            {
                var result = new NamingRule().GetPropertyName(input.Item1);
                Assert.AreEqual(input.Item2, result);
            }
        }
コード例 #29
0
        private async Task <string> ExecuteServerSideStrongModel(string testName, string templateFile, string dataFile)
        {
            var cacheProvider  = new NullCacheProvider();
            var namingRule     = new NamingRule();
            var handlerFactory = new NullRenderingHelperHandlerFactory();

            var templateInfo = new FileTemplateInfo(testName, PathInfo.Create(templateFile), new FileSystem());

            var schemaProvider = new HandlebarsViewSchemaProvider(handlerFactory, new MemberLocatorFromNamingRule(namingRule));

            var generator = new JsonSchemaCodeGenerator(namingRule);
            var schema    = await schemaProvider.GetSchemaFromTemplateAsync(templateInfo).ConfigureAwait(false);

            schema.Title = "Model";
            var modelType = generator.Compile(schema);

            var viewEngine = new VeilViewEngine(cacheProvider, handlerFactory, namingRule);
            var view       = await viewEngine.CreateViewAsync(templateInfo, modelType).ConfigureAwait(false);

            if (view == null)
            {
                Assert.Fail("Could not create view from file '{0}'.", templateFile);
            }

            object model;

            using (var reader = new JsonTextReader(new StreamReader(dataFile)))
            {
                model = JsonSerializer.Create().Deserialize(reader, modelType);
            }

            this.TestContext.BeginTimer("ServerStrong");
            var builder = new StringBuilder();

            using (var writer = new StringWriterDelayed(builder))
            {
                view.Render(model, new RenderingContext(writer));
            }
            var resultString = builder.ToString();

            this.TestContext.EndTimer("ServerStrong");
            return(resultString);
        }
コード例 #30
0
        public void DeleteFK(IDataContext db, string columnName)
        {
            if (db == null)
            {
                throw new ArgumentNullException("session");
            }
            if (string.IsNullOrEmpty(columnName))
            {
                throw new ArgumentNullException("columnName");
            }
            if (!NamingRule.IsValidSqlName(columnName))
            {
                throw new ArgumentOutOfRangeException("columnName");
            }

            var fkName = this.GenerateFkName(columnName);

            this.DeleteConstraint(db, fkName);
        }
コード例 #31
0
		internal NameConventionRule (NamingRule wrappedRule)
		{
			this.wrappedRule = wrappedRule;
		}
コード例 #32
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"));
		}
コード例 #33
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"));
		}
コード例 #34
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"));
		}
コード例 #35
0
		public void TestCase70925()
		{
			var rule = new NamingRule(AffectedEntity.Field);
			rule.NamingStyle = NamingStyle.PascalCase;
			System.Collections.Generic.IList<string> suggestedNames;
			rule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), "_taskStatus", out suggestedNames); 
			Assert.IsTrue(suggestedNames.Contains("TaskStatus"));
		}
コード例 #36
0
		public void TestSuggestionForPascalCase()
		{
			var rule = new NamingRule(AffectedEntity.Class);
			rule.NamingStyle = NamingStyle.PascalCase;
			System.Collections.Generic.IList<string> suggestedNames;
			rule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), "pascalCase_12_____12323", out suggestedNames); 
			Assert.IsTrue(suggestedNames.Contains("PascalCase_12_12323"));
		}
コード例 #37
0
		public void TestSuggestionForPascalCaseWithLowerStart()
		{
			var rule = new NamingRule(AffectedEntity.Class);
			rule.NamingStyle = NamingStyle.PascalCaseWithLowerLetterUnderscore;
			System.Collections.Generic.IList<string> suggestedNames;
			rule.GetErrorMessage(new TestRefactoringContext (null, TextLocation.Empty, null), "PascalCase_UnderscoreTolerant", out suggestedNames); 
			Assert.IsTrue(suggestedNames.Contains("PascalCase_underscoreTolerant"));
		}
コード例 #38
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"));
		}
コード例 #39
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"));
		}