private void TestDatabaseEntries(List <DatabasePackage> GlobalDependencies, List <Dependency> Dependencies, List <Category> ParsedCategoryList, bool checkDuplicates) { List <DatabasePackage> allPackages = DatabaseUtils.GetFlatList(GlobalDependencies, Dependencies, ParsedCategoryList); Assert.IsNotNull(allPackages); foreach (DatabasePackage package in allPackages) { Assert.IsFalse(string.IsNullOrWhiteSpace(package.CompletePackageNamePath)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.CompletePath)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.CompleteUIDPath)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.ComponentInternalName)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.PackageName)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.UID)); } List <SelectablePackage> selectablePackages = DatabaseUtils.GetFlatSelectablePackageList(ParsedCategoryList); Assert.IsNotNull(selectablePackages); if (checkDuplicates) { List <string> duplicatesPackageNames = null; List <DatabasePackage> duplicatesUID = null; duplicatesPackageNames = DatabaseUtils.CheckForDuplicates(GlobalDependencies, Dependencies, ParsedCategoryList); duplicatesUID = DatabaseUtils.CheckForDuplicateUIDsPackageList(GlobalDependencies, Dependencies, ParsedCategoryList); Assert.IsTrue(duplicatesPackageNames.Count == 0); Assert.IsTrue(duplicatesUID.Count == 0); } }
private void TestDatabaseEntries() { Assert.IsNotNull(databaseManager); //test flat list function (all packages) List <DatabasePackage> allPackages = DatabaseUtils.GetFlatList(databaseManager.GlobalDependencies, databaseManager.Dependencies, databaseManager.ParsedCategoryList); Assert.IsNotNull(allPackages); Assert.IsFalse(allPackages.Count == 0); foreach (DatabasePackage package in allPackages) { Assert.IsFalse(string.IsNullOrWhiteSpace(package.CompletePackageNamePath)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.CompletePath)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.CompleteUIDPath)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.ComponentInternalName)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.PackageName)); Assert.IsFalse(string.IsNullOrWhiteSpace(package.UID)); } //we're not technically checking these functions, but at least they should be able to run without throwing an exception, right? DatabaseUtils.BuildDependencyPackageRefrences(databaseManager.ParsedCategoryList, databaseManager.Dependencies); DatabaseUtils.CalculateDependencies(databaseManager.Dependencies, databaseManager.ParsedCategoryList, true, false); //test flat list function (selectable packages) List <SelectablePackage> selectablePackages = DatabaseUtils.GetFlatSelectablePackageList(databaseManager.ParsedCategoryList); Assert.IsNotNull(selectablePackages); //test duplicate finder functions List <string> duplicatesPackageNames = DatabaseUtils.CheckForDuplicates(databaseManager.GlobalDependencies, databaseManager.Dependencies, databaseManager.ParsedCategoryList); List <DatabasePackage> duplicatesUID = DatabaseUtils.CheckForDuplicateUIDsPackageList(databaseManager.GlobalDependencies, databaseManager.Dependencies, databaseManager.ParsedCategoryList); Assert.IsTrue(duplicatesPackageNames.Count == 0); Assert.IsTrue(duplicatesUID.Count == 0); }