public void SaveShapesTest1() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 5)); shapeBUS.CreateEllipse(); shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 8)); shapeBUS.AddPoint(new Point(5, 4)); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.CreatePolygon(); shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(3, 50)); shapeBUS.CreatePolyline(); shapeBUS.AddPoint(new Point(5, 5)); shapeBUS.CreatePolyline(); shapeBUS.SaveShapes("test.xaml"); var fileText = File.ReadLines("test.xaml"); Assert.IsTrue(fileText.ToString().Length > 1); }
public void CreatePolygonTest_With3Points() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 8)); shapeBUS.AddPoint(new Point(5, 4)); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.CreatePolygon(); }
public void NewShapeForCancasTest1() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 8)); shapeBUS.AddPoint(new Point(5, 4)); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.CreatePolygon(); CanvasBUS.NewShapeForCancas(shapeBUS.Shapes[0] as PolygonShape); }
public void CreatePolygonTest2_With6Points() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 5)); shapeBUS.AddPoint(new Point(6, 5)); shapeBUS.AddPoint(new Point(9, 5)); shapeBUS.AddPoint(new Point(15, 5)); shapeBUS.AddPoint(new Point(12, 4)); shapeBUS.AddPoint(new Point(15, 15)); shapeBUS.CreatePolygon(); }
public void MoveShapeTest1() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 8)); shapeBUS.AddPoint(new Point(5, 4)); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.CreatePolygon(); shapeBUS.ChooseShape("Polygon 1"); shapeBUS.SetShapeMarginAndStartMovePoint(new Point(0, 1)); shapeBUS.MoveShape(new Point(2, 3)); }
public void FillShapeTest2() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 8)); shapeBUS.AddPoint(new Point(5, 4)); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.CreatePolygon(); Color color = Color.FromRgb(255, 255, 255); shapeBUS.FillShape(color); }
public void FillShapeTest1() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 8)); shapeBUS.AddPoint(new Point(5, 4)); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.CreatePolygon(); shapeBUS.ChooseShape("Polygon 1"); Color color = Color.FromRgb(0, 0, 0); shapeBUS.FillShape(color); }