public void DeleteSegmentCommandRedo() { this.PatchSketchObject.Width = 3; this.PatchSketchObject.ResolutionWidth = 4; this.PatchSketchObject.ResolutionHeight = 4; AddSegmentCommand addCommand = new AddSegmentCommand(this.PatchSketchObject, new List <Vector3> { new Vector3(0, 0, 0), new Vector3(1, 0, 0), new Vector3(2, 0, 0) }); Invoker.ExecuteCommand(addCommand); addCommand = new AddSegmentCommand(this.PatchSketchObject, new List <Vector3> { new Vector3(0, 0, 2), new Vector3(1, 1, 2), new Vector3(2, 0, 2) }); Invoker.ExecuteCommand(addCommand); addCommand = new AddSegmentCommand(this.PatchSketchObject, new List <Vector3> { new Vector3(0, 0, 3), new Vector3(1, 0, 3), new Vector3(2, 0, 3) }); Invoker.ExecuteCommand(addCommand); DeleteSegmentCommand deleteCommand = new DeleteSegmentCommand(this.PatchSketchObject); Invoker.ExecuteCommand(deleteCommand); Invoker.Undo(); Invoker.Redo(); Assert.AreEqual(null, this.PatchSketchObject.GetComponent <MeshFilter>().sharedMesh); Assert.AreEqual(6, this.PatchSketchObject.GetControlPoints().Count); }
public void DeleteFirstSegmentCommand() { this.PatchSketchObject.Width = 3; this.PatchSketchObject.ResolutionWidth = 4; this.PatchSketchObject.ResolutionHeight = 4; AddSegmentCommand addCommand = new AddSegmentCommand(this.PatchSketchObject, new List <Vector3> { new Vector3(0, 0, 0), new Vector3(1, 0, 0), new Vector3(2, 0, 0) }); Invoker.ExecuteCommand(addCommand); DeleteSegmentCommand deleteCommand = new DeleteSegmentCommand(this.PatchSketchObject); Invoker.ExecuteCommand(deleteCommand); Assert.AreEqual(null, this.PatchSketchObject.GetComponent <MeshFilter>().sharedMesh); Assert.AreEqual(0, this.PatchSketchObject.GetControlPoints().Count); Assert.IsTrue(SketchWorld.ActiveSketchWorld.IsObjectDeleted(this.PatchSketchObject)); }