public void FixtureSetup()
        {
            var connection = ConfigurationManager.ConnectionStrings[MiscConstants.GetEfDatabaseConfigName()].ConnectionString;
            var allSqlInfo = SqlAllInfo.SqlAllInfoFactory(connection);

            _sqlInfos = allSqlInfo.TableInfos;
        }
Esempio n. 2
0
        public void Test10CreateNewEfDatabase()
        {
            //SETUP

            //EXECUTE
            DatabaseCreators.DeleteAndCreateEfDatabase <TestEf6SchemaCompareDb>(MiscConstants.GetEfDatabaseConfigName(), true);

            //VERIFY
        }
        public void Test30GetNonPrimaryKeyIndexesOk()
        {
            //SETUP
            var connection = ConfigurationManager.ConnectionStrings[MiscConstants.GetEfDatabaseConfigName()].ConnectionString;

            //EXECUTE
            var result = SqlIndex.GetAllIndexes(connection);

            //VERIFY
            result.Count.ShouldBeGreaterThan(8);
        }
        public void Test20GetPrimaryKeysNamesOk()
        {
            //SETUP
            var connection = ConfigurationManager.ConnectionStrings[MiscConstants.GetEfDatabaseConfigName()].ConnectionString;

            //EXECUTE
            var result = SqlPrimaryKey.GetPrimaryKeysNames(connection, typeof(DataManyCompKey).Name);

            //VERIFY
            result.Count.ShouldEqual(2);
        }
        public void Test10GetForeignKeysOk()
        {
            //SETUP
            var connection = ConfigurationManager.ConnectionStrings[MiscConstants.GetEfDatabaseConfigName()].ConnectionString;

            //EXECUTE
            var result = SqlForeignKey.GetForeignKeys(connection);

            //VERIFY
            result.Count.ShouldBeGreaterThan(3);
        }
        public void Test01SqlTableAndColumnDataOk()
        {
            //SETUP
            var connection = ConfigurationManager.ConnectionStrings[MiscConstants.GetEfDatabaseConfigName()].ConnectionString;

            //EXECUTE
            var result = SqlTableAndColumnData.GetSqlTablesAndColumns(connection);

            //VERIFY
            result.Count.ShouldBeGreaterThan(3);
        }
Esempio n. 7
0
        public void Test01CheckDatabaseString()
        {
            //SETUP

            //EXECUTE
            var conStr =
                MiscConstants.GetEfDatabaseConfigName().GetConnectionStringAndCheckValid();

            //VERIFY
            conStr.ShouldNotEqualNull();
        }
        public void Test20CompareSqlToSqlDbUpWithConfigLookupOk()
        {
            //SETUP
            var comparer = new CompareSqlSql();

            //EXECUTE
            var status = comparer.CompareSqlToSql(MiscConstants.GetEfDatabaseConfigName(), MiscConstants.DbUpDatabaseConfigName);

            //VERIFY
            status.ShouldBeValid();
            status.HasWarnings.ShouldEqual(false, string.Join("\n", status.Warnings));
        }
        public void Test01CompareSqlToSqlSelfOk()
        {
            //SETUP
            var connection = ConfigurationManager.ConnectionStrings[MiscConstants.GetEfDatabaseConfigName()].ConnectionString;
            var comparer   = new CompareSqlSql();

            //EXECUTE
            var status = comparer.CompareSqlToSql(connection, connection);

            //VERIFY
            status.ShouldBeValid();
            status.HasWarnings.ShouldEqual(false, string.Join("\n", status.Warnings));
        }
        public void Test10CompareSqlToSqlDbUpIndexAsWarningsOk()
        {
            //SETUP
            var connection1 = ConfigurationManager.ConnectionStrings[MiscConstants.GetEfDatabaseConfigName()].ConnectionString;
            var connection2 = ConfigurationManager.ConnectionStrings[MiscConstants.DbUpDatabaseConfigName].ConnectionString;
            var comparer    = new CompareSqlSql(false);

            //EXECUTE
            var status = comparer.CompareSqlToSql(connection1, connection2);

            //VERIFY
            status.ShouldBeValid();
            foreach (var warning in status.Warnings)
            {
                Console.WriteLine(warning);
            }
            //status.HasWarnings.ShouldEqual(false, string.Join("\n", status.Warnings));
        }
Esempio n. 11
0
        public void Test60EfCreatedDatabaseExists()
        {
            //SETUP

            //EXECUTE
            var ex =
                Assert.Throws <InvalidOperationException>(
                    () =>
                    DatabaseCreators.DeleteAndCreateEfDatabase <TestEf6SchemaCompareDb>(MiscConstants.GetEfDatabaseConfigName()));

            //VERIFY
            ex.Message.ShouldEqual(
                "You attempted to wipe the main database that your DbContext points to. To do this you must set the second parameter to this method to true.");
        }