public void ToForeignKeyNameNoCustomMethodTest()
        {
            NamingConventionsConfig config = new NamingConventionsConfig(null);
            NamingEngine namingEngine = new NamingEngine(config);

            // Component Table Name => Custom convention
            config.UseConventionForForeignKeyNames(ForeignKeyNamingConvention.Custom);
            string result = namingEngine.ToForeignKeyName(typeof(City), typeof(State), typeof(City).GetMember("State").Single(), typeof(State).GetMember("ID").Single());
        }
        public void ToForeignKeyNameEntityNameIdNameTest()
        {
            NamingConventionsConfig config = new NamingConventionsConfig(null);
            NamingEngine namingEngine = new NamingEngine(config);

            config.UseConventionForPrimaryKeyColumnNames(PrimaryKeyColumnNamingConvention.EntityName_IdPropertyName);
            config.UseConventionForForeignKeyColumnNames(ForeignKeyColumnNamingConvention.PropertyNameIdPropertyName);
            config.UseConventionForConstraintNames(ConstraintNamingConvention.Lowercase);

            // Foreign Key Name => Default
            config.UseConventionForForeignKeyNames(ForeignKeyNamingConvention.Default);
            string result = namingEngine.ToForeignKeyName(typeof(City), typeof(State), typeof(City).GetMember("State").Single(), typeof(State).GetMember("ID").Single());
            Assert.IsTrue(string.IsNullOrEmpty(result));

            // Foreign Key Name => FK_FKTable_PKTable
            config.UseConventionForForeignKeyNames(ForeignKeyNamingConvention.FK_FKTable_PKTable);
            result = namingEngine.ToForeignKeyName(typeof(City), typeof(State), typeof(City).GetMember("State").Single(), typeof(State).GetMember("ID").Single());
            Assert.AreEqual("fk__city__state", result);

            // Foreign Key Name => FK_FKTable_PKTable_PKColumn
            config.UseConventionForForeignKeyNames(ForeignKeyNamingConvention.FK_FKTable_PKTable_FKColumn);
            result = namingEngine.ToForeignKeyName(typeof(City), typeof(State), typeof(City).GetMember("State").Single(), typeof(State).GetMember("ID").Single());
            Assert.AreEqual("fk__city__state__state_id", result);

            // Foreign Key Name => FKTable_PKTable_FK
            config.UseConventionForForeignKeyNames(ForeignKeyNamingConvention.FKTable_PKTable_FK);
            result = namingEngine.ToForeignKeyName(typeof(City), typeof(State), typeof(City).GetMember("State").Single(), typeof(State).GetMember("ID").Single());
            Assert.AreEqual("city__state__fk", result);

            // Foreign Key Name => FKTable_PKTable_PKColumn_FK
            config.UseConventionForForeignKeyNames(ForeignKeyNamingConvention.FKTable_PKTable_FKColumn_FK);
            result = namingEngine.ToForeignKeyName(typeof(City), typeof(State), typeof(City).GetMember("State").Single(), typeof(State).GetMember("ID").Single());
            Assert.AreEqual("city__state__state_id__fk", result);

            // Foreign Key Name => Custom
            config.UseCustomConventionForForeignKeyNames((s, t, f, i) =>
            {
                Assert.AreEqual(typeof(City), s);
                Assert.AreEqual(typeof(State), t);
                Assert.AreEqual(typeof(City).GetMember("State").Single(), f);
                Assert.AreEqual(typeof(State).GetMember("ID").Single(), i);

                return "CustomForeignKeyName";
            });
            result = namingEngine.ToForeignKeyName(typeof(City), typeof(State), typeof(City).GetMember("State").Single(), typeof(State).GetMember("ID").Single());
            Assert.AreEqual("CustomForeignKeyName", result);
        }