Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ContainsEmptyListOrNullTest test #15190

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
});
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DoEventsLoop will fail after 20 seconds if the function argument does not return true.


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
Loading