public void DeleteOneControlPointWithCommand() { AddControlPointCommand command = new AddControlPointCommand(this.LineSketchObject, new Vector3(1, 2, 3)); Invoker.ExecuteCommand(command); DeleteControlPointCommand deleteCommand = new DeleteControlPointCommand(this.LineSketchObject); Invoker.ExecuteCommand(deleteCommand); Assert.AreEqual(this.LineSketchObject.getNumberOfControlPoints(), 0); Assert.IsTrue(SketchWorld.ActiveSketchWorld.IsObjectDeleted(this.LineSketchObject)); }
public void AddMultipleControlPointsAndDeleteOneWithCommand() { AddControlPointCommand command = new AddControlPointCommand(this.LineSketchObject, new Vector3(1, 2, 3)); Invoker.ExecuteCommand(command); command = new AddControlPointCommand(this.LineSketchObject, new Vector3(2, 3, 4)); Invoker.ExecuteCommand(command); command = new AddControlPointCommand(this.LineSketchObject, new Vector3(3, 3, 3)); Invoker.ExecuteCommand(command); command = new AddControlPointCommand(this.LineSketchObject, new Vector3(4, 3, 2)); Invoker.ExecuteCommand(command); ICommand deleteCommand = new DeleteControlPointCommand(this.LineSketchObject); Invoker.ExecuteCommand(deleteCommand); Assert.AreEqual(this.LineSketchObject.getNumberOfControlPoints(), 3); Assert.AreEqual((2 * 20 + 2) * 7, this.LineSketchObject.GetComponent <MeshFilter>().sharedMesh.vertices.Length); }