コード例 #1
0
        /// <summary>
        /// Convert string to proper case
        /// </summary>
        /// <param name="sourceString">The source string.</param>
        /// <returns></returns>
        public static string ToProper(string sourceString)
        {
            string propertyName = Inflector.ToPascalCase(sourceString);

            //if(propertyName.EndsWith("TypeCode"))
            //    propertyName = propertyName.Substring(0, propertyName.Length - 4);

            return(propertyName);
        }
コード例 #2
0
        public static string GetProperName(string sIn)
        {
            string propertyName = sIn;

            propertyName = Inflector.ToPascalCase(propertyName);
            if (propertyName.EndsWith("TypeCode"))
            {
                propertyName = propertyName.Substring(0, propertyName.Length - 4);
            }
            return(propertyName);
        }
コード例 #3
0
        /// <summary>
        /// Checks the pascal case.
        /// </summary>
        /// <param name="evalString">The eval string.</param>
        /// <param name="correctString">The correct string.</param>
        /// <param name="removeUnderscores">if set to <c>true</c> [remove underscores].</param>
        private static void CheckPascalCase(string evalString, string correctString, bool removeUnderscores)
        {
            string transform = Inflector.ToPascalCase(evalString, removeUnderscores);

            Assert.IsTrue(transform == correctString, evalString + " (remove underscores: " + removeUnderscores + ") - Should be: " + correctString + " - Actually is: " + transform);
        }