Beispiel #1
0
 public void Underscore()
 {
     foreach (var pair in TestData)
     {
         Assert.AreEqual(Inflector.Underscore(pair.Key), pair.Value);
     }
 }
Beispiel #2
0
        private static string NormalizeName(string name, string naming)
        {
            switch (naming)
            {
            case "Snake":
                return(Inflector.Underscore(name));

            case "UpperSnake":
                return(Inflector.Underscore(name, true));

            case "Camel":
                return(Inflector.Camelize(name));

            default:
                return(Inflector.Pascalize(name));
            }
        }
Beispiel #3
0
 public void TestUnderscore()
 {
     Assert.AreEqual("active_record", Inflector.Underscore("ActiveRecord"));
     Assert.AreEqual("active_record/errors", Inflector.Underscore("ActiveRecord::Errors"));
 }
Beispiel #4
0
 public string Underscore() => Inflector.Underscore("aaaBbbCccDdd");
        public void Apply(IPropertyInstance instance)
        {
            var propName = Inflector.Underscore(instance.Name.ToLower());

            instance.Column(propName);
        }