Skip to content

Commit

Permalink
Update GraphNodeManagerViewExtensionTests.cs (#15190)
Browse files Browse the repository at this point in the history
  • Loading branch information
pinzart90 authored May 6, 2024
1 parent b352d49 commit 9257a46
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,24 @@ public void ContainsEmptyListOrNullTest()

OpenAndRun(@"pkgs\Dynamo Samples\extra\GraphNodeManagerTestGraph_NullsEmptyLists.dyn");

Utility.DispatcherUtil.DoEvents();
var hwm = this.ViewModel.CurrentSpace;

var view = viewExt.ManagerView;
int nullNodesCount = hwm.Nodes.Count(ContainsAnyNulls);
int emptyListNodesCount = hwm.Nodes.Count(ContainsAnyEmptyLists);

var view = viewExt.ManagerView;
var images = WpfUtilities.ChildrenOfType<Image>(view.NodesInfoDataGrid);

int nullNodesImageCount = GetImageCount(images, "Null");
int emptyListNodesImageCount = GetImageCount(images, "EmptyList");
Utility.DispatcherUtil.DoEventsLoop(() =>
{
int nullNodesImageCount = GetImageCount(images, "Null");
int emptyListNodesImageCount = GetImageCount(images, "EmptyList");
var hwm = this.ViewModel.CurrentSpace;
return (nullNodesImageCount == nullNodesCount) && (emptyListNodesImageCount == emptyListNodesCount);
});

int nullNodesCount = hwm.Nodes.Count(ContainsAnyNulls);
int emptyListNodesCount = hwm.Nodes.Count(ContainsAnyEmptyLists);
int nullNodesImageCount = GetImageCount(images, "Null");
int emptyListNodesImageCount = GetImageCount(images, "EmptyList");

// Assert
Assert.AreEqual(emptyListNodesCount, emptyListNodesImageCount);
Expand Down

0 comments on commit 9257a46

Please sign in to comment.