public void DrawShapeGenerateJsonFromItAndConvertItBackToShape() { ITool CurrentTool = new RectangleTool(); CurrentTool.GetShape(new CanvasEventArgs(new Point(100, 200), MouseState.DOWN), style); CurrentTool.GetShape(new CanvasEventArgs(new Point(80, 170), MouseState.MOVE), style); CurrentTool.GetShape(new CanvasEventArgs(new Point(60, 100), MouseState.MOVE), style); TikzShape[] shapes = new TikzShape[] { CurrentTool.GetShape(new CanvasEventArgs(new Point(40, 40), MouseState.UP), style).TikzShape }; JsonFormatGenerator jsonGen = new JsonFormatGenerator(); String jsonTikz = jsonGen.ConvertMany(shapes); Assert.IsTrue(new JsonFormatLoader().ConvertMany(jsonTikz).ToList().Single(shape => shape is TikzRectangle) != null); }
public DrawingShape(TikzShape shape, ShapeState shapeState) { TikzShape = shape; ShapeState = shapeState; }