public void IndexGroup_EmptySecondSet_Success() { PrimaryIndexes.Add(isp1); IEnumerable <IndexGroup> Group = IndexGroup.PopulateIndexGroups(PrimaryIndexes, SecondaryIndexes); Assert.IsNotNull(Group); Assert.AreEqual(1, Group.Count()); Assert.AreEqual(0, Group.Where(x => x.ComparisonDiffers).Count()); }
public void IndexGroup_CIAndHeap_OneRow_Success() { PrimaryIndexes.Add(isp6); SecondaryIndexes.Add(iss6); IEnumerable <IndexGroup> Group = IndexGroup.PopulateIndexGroups(PrimaryIndexes, SecondaryIndexes, true); Assert.IsNotNull(Group); Assert.AreEqual(1, Group.Count()); //s6 & p6 linked together but differ Assert.AreEqual(1, Group.Where(x => x.ComparisonDiffers).Count()); }
public void IndexGroup_IgnoreMissingTables_PrimaryMissingTable_Success() { PrimaryIndexes.Add(isp1); SecondaryIndexes.Add(iss1); SecondaryIndexes.Add(iss3); IEnumerable <IndexGroup> Group = IndexGroup.PopulateIndexGroups(PrimaryIndexes, SecondaryIndexes, true); Assert.IsNotNull(Group); Assert.AreEqual(1, Group.Count()); //1=1; s3 missing Assert.AreEqual(0, Group.Where(x => x.ComparisonDiffers).Count()); }
public void IndexGroup_ExtraInFirstSet_MatchingGroup_Success() { PrimaryIndexes.Add(isp1); PrimaryIndexes.Add(isp2); SecondaryIndexes.Add(iss1); IEnumerable <IndexGroup> Group = IndexGroup.PopulateIndexGroups(PrimaryIndexes, SecondaryIndexes); Assert.IsNotNull(Group); Assert.AreEqual(2, Group.Count()); Assert.AreEqual(0, Group.Where(x => x.ComparisonDiffers).Count()); }
public void IndexGroup_TwoMatches_OneDifferent_Success() { PrimaryIndexes.Add(isp1); PrimaryIndexes.Add(isp3); SecondaryIndexes.Add(iss1); SecondaryIndexes.Add(iss2); SecondaryIndexes.Add(iss3); IEnumerable <IndexGroup> Group = IndexGroup.PopulateIndexGroups(PrimaryIndexes, SecondaryIndexes); Assert.IsNotNull(Group); Assert.AreEqual(3, Group.Count()); Assert.AreEqual(1, Group.Where(x => x.ComparisonDiffers).Count()); }
public void IndexGroup_ThreeMatches_TwoDifferent_Success() { PrimaryIndexes.Add(isp1); PrimaryIndexes.Add(isp2); PrimaryIndexes.Add(isp3); PrimaryIndexes.Add(isp4); SecondaryIndexes.Add(iss1); SecondaryIndexes.Add(iss2); SecondaryIndexes.Add(iss3); SecondaryIndexes.Add(iss4); IEnumerable <IndexGroup> Group = IndexGroup.PopulateIndexGroups(PrimaryIndexes, SecondaryIndexes); Assert.IsNotNull(Group); Assert.AreEqual(5, Group.Count()); //1=1, p2, s2, 3~=3, 4~=4 Assert.AreEqual(2, Group.Where(x => x.ComparisonDiffers).Count()); //3 & 4 differ }
private void PopulateGrid(bool ForceRefresh) { //Show the waiting page. SetVisibility(PageToShow.Waiting); //Set the async values MainWindowValues mwvSetup = LoadMainWindowValues(ForceRefresh); System.Windows.Threading.Dispatcher d = this.Dispatcher; //Set up a worker BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += delegate(object sender, DoWorkEventArgs e) { try { MainWindowValues mwv = e.Argument as MainWindowValues; if (mwv.ForceRefresh || mwv.DatabaseListingChanged || PrimaryGroup == null || SecondaryGroup == null) { PrimaryGroup = IndexSet.RetrieveIndexData(mwv.CurrentPrimaryInstanceName, mwv.CurrentPrimaryDatabaseName); SecondaryGroup = IndexSet.RetrieveIndexData(mwv.CurrentSecondaryInstanceName, mwv.CurrentSecondaryDatabaseName); Groups = IndexGroup.PopulateIndexGroups(PrimaryGroup, SecondaryGroup, mwv.IgnoreMissingTables); } //Now update the display RefreshGridDelegate refresh = new RefreshGridDelegate(RefreshDataGrid); d.BeginInvoke(refresh, mwv, Groups); } catch (Exception ex) { ShowErrorDelegate error = new ShowErrorDelegate(ShowErrorMessage); d.BeginInvoke(error, ex.Message); } }; worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted); worker.RunWorkerAsync(mwvSetup); }