Beispiel #1
0
        public void DatabaseCollector_Collect()
        {
            var db = _databaseCollector.Collect("AdventureWorks2012");

            Assert.That(db.StoredProcedures.Count, Is.EqualTo(10));
            Assert.That(db.Tables.Count, Is.EqualTo(71));

            var countryRegionTable = db.Tables.Find(f => f.FullyQualifiedName == "AdventureWorks2012.Person.CountryRegion");

            Assert.IsNotNull(countryRegionTable);
            Assert.That(countryRegionTable.DependentTables.Count, Is.EqualTo(3));

            var person = db.Tables.Find(f => f.FullyQualifiedName == "AdventureWorks2012.Person.Person");

            Assert.That(person.DependentTables.Count, Is.EqualTo(7));
        }
Beispiel #2
0
        /// <summary>
        ///  Garbage Collect the tables in this database, removing any
        ///  unreachable rows.
        /// </summary>
        public bool Collect()
        {
            DatabaseCollector collector = new DatabaseCollector(this);

            return(collector.Collect());
        }