public void TestDraggedNode() { var model = dynSettings.Controller.DynamoModel; model.CreateNode(16, 32, "Add"); NodeModel locatable = Controller.DynamoViewModel.Model.Nodes[0]; Point startPoint = new Point(8, 64); var dn = new WorkspaceViewModel.DraggedNode(locatable, startPoint); // Initial node position. Assert.AreEqual(16, locatable.X); Assert.AreEqual(32, locatable.Y); // Move the mouse cursor to move node. dn.Update(new Point(-16, 72)); Assert.AreEqual(-8, locatable.X); Assert.AreEqual(40, locatable.Y); }
public void TestDraggedNode() { var addNode = new DSFunction(ViewModel.Model.LibraryServices.GetFunctionDescriptor("+")) { X = 16, Y = 32 }; ViewModel.Model.CurrentWorkspace.AddAndRegisterNode(addNode, false); NodeModel locatable = ViewModel.Model.CurrentWorkspace.Nodes.First(); var startPoint = new Point2D(8, 64); var dn = new WorkspaceViewModel.DraggedNode(locatable, startPoint); // Initial node position. Assert.AreEqual(16, locatable.X); Assert.AreEqual(32, locatable.Y); // Move the mouse cursor to move node. dn.Update(new Point2D(-16, 72)); Assert.AreEqual(-8, locatable.X); Assert.AreEqual(40, locatable.Y); }