Exemplo n.º 1
0
 public void Underscore()
 {
     foreach (var pair in TestData)
     {
         Assert.AreEqual(Inflector.Underscore(pair.Key), pair.Value);
     }
 }
Exemplo n.º 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));
            }
        }
Exemplo n.º 3
0
 public void TestUnderscore()
 {
     Assert.AreEqual("active_record", Inflector.Underscore("ActiveRecord"));
     Assert.AreEqual("active_record/errors", Inflector.Underscore("ActiveRecord::Errors"));
 }
Exemplo n.º 4
0
 public string Underscore() => Inflector.Underscore("aaaBbbCccDdd");
        public void Apply(IPropertyInstance instance)
        {
            var propName = Inflector.Underscore(instance.Name.ToLower());

            instance.Column(propName);
        }