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 CreatePolylineTest_With2Points() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 5)); shapeBUS.CreatePolyline(); }
public void CreateEllipseTest4_With2Points() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, -5)); shapeBUS.CreateEllipse(); }
public void GetShapesTest1() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 5)); shapeBUS.CreateEllipse(); shapeBUS.GetShapes("dd.xaml"); }
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 NewShapeForCancasTest2() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 5)); shapeBUS.CreateEllipse(); CanvasBUS.NewShapeForCancas(shapeBUS.Shapes[0] as EllipseShape); }
public void CreatePentagonTest_With5Points() { 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.CreatePentagon(); }
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 GetShapesTest1() { 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.CreatePentagon(); shapeBUS.GetShapes("testing.xaml"); }
public void NewShapeForCancasTest3() { 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(); CanvasBUS.NewShapeForCancas(shapeBUS.Shapes[0] as PolylineShape); }
public void RemoveAllPointTest() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 6)); shapeBUS.AddPoint(new Point(4, 0)); shapeBUS.RemoveAllPoint(); int expected = 0; int actual = shapeBUS.Shapes.Count; Assert.AreEqual(expected, actual); }
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 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, 5)); shapeBUS.AddPoint(new Point(6, 5)); shapeBUS.AddPoint(new Point(9, 5)); shapeBUS.AddPoint(new Point(15, 5)); shapeBUS.CreatePentagon(); Color color = Color.FromRgb(255, 255, 255); shapeBUS.FillShape(color); }
public void ChooseShapeTest() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.AddPoint(new Point(5, 6)); shapeBUS.CreateEllipse(); shapeBUS.ChooseShape("Ellipse 1"); int expected = 0; int actual = shapeBUS.ChoosenShapeIndex; Assert.AreEqual(expected, actual); }
public void NewShapeForCancasTest4() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); CanvasBUS.NewShapeForCancas(shapeBUS.Shapes[0] as PointShape); }
public void MoveShapeTest1() { 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.CreatePentagon(); shapeBUS.ChooseShape("Pentagon_1"); shapeBUS.SetShapeMarginAndStartMovePoint(new Point(0, 1)); shapeBUS.MoveShape(new Point(2, 3)); }
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); }
public void CreateHexagonTest_With1Points() { shapeBUS = new ShapeBUS(); shapeBUS.AddPoint(new Point(0, 0)); shapeBUS.CreateHexagon(); }
public void SaveShapesTest1() { 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.CreatePentagon(); shapeBUS.SaveShapes("test.xaml"); var fileText = File.ReadLines("test.xaml"); Assert.IsTrue(fileText.ToString().Length > 1); }
public void FillShapeTest1() { 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.CreatePentagon(); shapeBUS.ChooseShape("Pentagon_1"); Color color = Color.FromRgb(0, 0, 0); shapeBUS.FillShape(color); }
private void CanvasPaint_MouseDown(object sender, MouseButtonEventArgs e) { if (action != null && e.LeftButton == MouseButtonState.Pressed) { bus.AddPoint(Mouse.GetPosition(CanvasPaint)); action(); } }
public void ChooseShapeTest() { 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.CreatePentagon(); shapeBUS.ChooseShape("Pentagon_1"); int expected = 0; int actual = shapeBUS.ChoosenShapeIndex; Assert.AreEqual(expected, actual); }
public void AddPointTest() { shapeBUS = new ShapeBUS(); Point expectedPoint = new Point(5, 5); shapeBUS.AddPoint(expectedPoint); Point actualPoint = new Point((shapeBUS.Shapes[0] as MyPoint).X, (shapeBUS.Shapes[0] as MyPoint).Y); Assert.AreEqual(expectedPoint, actualPoint); }
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(); }