Exemple #1
0
        public void GetDatabaseObjectHashesTest()
        {
            Initialization       init   = new Initialization();
            ConnectionData       data   = init.connData;
            ObjectScriptHelper   target = new ObjectScriptHelper(data);
            ObjectScriptHashData actual;

            actual = target.GetDatabaseObjectHashes();
            Assert.IsNotNull(actual);
            Assert.AreEqual("C9D84C93D15E8D9ADF4F78BF8B97C051", actual.Tables["dbo.TransactionTest"].HashValue);
            Assert.AreEqual("Added", actual.Tables["dbo.TransactionTest"].ComparisonValue);
        }
        public void GetDatabaseObjectHashesTest_BadDatabase()
        {
            Initialization init = new Initialization();
            ConnectionData data = init.connData;

            data.DatabaseName = "BADNAME";
            ObjectScriptHelper   target = new ObjectScriptHelper(data);
            ObjectScriptHashData actual;

            actual = target.GetDatabaseObjectHashes();
            Assert.IsNull(actual);
        }
        public void CollectHashes()
        {
            if (this.HashCollectionRunnerUpdate != null)
            {
                HashCollectionRunnerUpdate(this, new HashCollectionRunnerUpdateEventArgs(this.serverName, this.databaseName, "Starting"));
            }

            ConnectionData     connData = new ConnectionData(serverName, databaseName);
            ObjectScriptHelper helper   = new ObjectScriptHelper(connData);

            helper.HashScriptingEvent += new ObjectScriptHelper.HashScriptingEventHandler(helper_HashScriptingEvent);
            this.hashData              = helper.GetDatabaseObjectHashes();
            if (hashData != null)
            {
                this.hashData.IsBaseLine = isBaseLine;
            }
            else
            {
                hashData = new ObjectScriptHashData();
            }
            this.hashData.Database = this.databaseName;
            this.hashData.Server   = this.serverName;
        }