Skip to content

Commit

Permalink
update the selection unit test (#15103)
Browse files Browse the repository at this point in the history
  • Loading branch information
QilongTang authored Apr 9, 2024
1 parent 817c688 commit 0d6f89c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
5 changes: 2 additions & 3 deletions test/DynamoCoreWpfTests/NodeViewTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ public void TestSelectNeighborPins()
DynamoSelection.Instance.Selection.Clear();

// Select the node
var nodeView = NodeViewWithGuid("80eca4d6-45bf-4c54-9412-d7d175c9a9b5");
var nodeView = NodeViewWithGuid("a0d7d02a-df09-455e-bd04-c38def8f3e07");

NodeViewModel nodeVM = (nodeView.DataContext as NodeViewModel);
WorkspaceModel ws = nodeVM.DynamoViewModel.CurrentSpace;
Expand All @@ -663,14 +663,13 @@ public void TestSelectNeighborPins()
var countBefore = DynamoSelection.Instance.Selection.Count;
Assert.AreEqual(1, countBefore);

// Run method ans assert whether more nodes were selected
// Run method and assert whether more nodes were selected
nodeVM.NodeModel.SelectNeighbors();

var modelsSelected = DynamoSelection.Instance.Selection.Select(s => s as ModelBase);
var countAfter = modelsSelected.Count();

Assert.AreEqual(5, countAfter);

}
}
}
36 changes: 21 additions & 15 deletions test/core/ConnectorPinSelectionTest.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@
},
{
"Start": "5da9bf8a700c409bb37ec5b15f93f509",
"End": "c2b90a87544c4c1796b0452a94b93948",
"Id": "59214901d88d4940bd97c323d5dd1835",
"End": "f97306cf803e409cb395c6a2a61f4e18",
"Id": "70a4abb9e07c4e80b7797c28bceedb43",
"IsHidden": "False"
},
{
"Start": "5da9bf8a700c409bb37ec5b15f93f509",
"End": "f97306cf803e409cb395c6a2a61f4e18",
"Id": "70a4abb9e07c4e80b7797c28bceedb43",
"End": "c2b90a87544c4c1796b0452a94b93948",
"Id": "a622ae3642ed462696f7ca4c05394344",
"IsHidden": "False"
}
],
"Dependencies": [],
"NodeLibraryDependencies": [],
"EnableLegacyPolyCurveBehavior": null,
"EnableLegacyPolyCurveBehavior": true,
"Thumbnail": "",
"GraphDocumentationURL": null,
"ExtensionWorkspaceData": [
Expand Down Expand Up @@ -165,16 +165,22 @@
},
"ConnectorPins": [
{
"Left": 570.0,
"Top": 94.0001,
"Left": 264.09530143377094,
"Top": 257.73218770417003,
"IsHidden": false,
"ConnectorGuid": "70a4abb9-e07c-4e80-b779-7c28bceedb43"
},
{
"Left": 281.3766210423312,
"Top": 210.6627915786814,
"IsHidden": false,
"ConnectorGuid": "66f58071-534f-4710-96e0-68d5aa11987d"
"ConnectorGuid": "a622ae36-42ed-4626-96f7-ca4c05394344"
},
{
"Left": 268.0,
"Top": 44.0001,
"Left": 561.3765041866548,
"Top": 205.37993194560642,
"IsHidden": false,
"ConnectorGuid": "aef055ee-0f7a-4e99-993e-9947275ca71b"
"ConnectorGuid": "dd11a60a-ae71-472e-9b5c-3613e9095574"
}
],
"NodeViews": [
Expand All @@ -196,7 +202,7 @@
"Excluded": false,
"ShowGeometry": true,
"X": 96.5,
"Y": 198.0
"Y": 199.07317839436
},
{
"Id": "7cdc095c2d41415b9935b44c990ee782",
Expand All @@ -210,8 +216,8 @@
}
],
"Annotations": [],
"X": 0.0,
"Y": 0.0,
"Zoom": 1.0
"X": -65.75259710831733,
"Y": 92.39817788510285,
"Zoom": 1.0987122290256521
}
}

0 comments on commit 0d6f89c

Please sign in to comment.