public void AddPointsTest()
		{
			Point2D[] points1 = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };

			GraphicsFigure2D f1 = new GraphicsFigure2D(points1, false);

			f1.Points.Add(new Point2D(5, 5));
		}
		public void ToStringTest()
		{
			Point2D[] points1 = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };
			GraphicsFigure2D f1 = new GraphicsFigure2D(points1);

			string expected = String.Format("[{0}] Number of {1} points: 4; Closed: False", typeof(GraphicsFigure2D), typeof(Point2D).Name);
			Assert.AreEqual(expected, f1.ToString());
		}
		public void CloneTest()
		{
			Point2D[] points1 = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };

			GraphicsFigure2D f1 = new GraphicsFigure2D(points1);
			GraphicsFigure<Point2D, Rectangle2D> f2 = f1.Clone();
			GraphicsFigure2D f3 = (f1 as ICloneable).Clone() as GraphicsFigure2D;

			Assert.AreEqual(f1, f2);
			Assert.AreEqual(f1, f3);
		}
		public void CreateNewTest()
		{
			Point2D[] points = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };
			GraphicsFigure2D f1 = new GraphicsFigure2D(points, true);
			Assert.AreEqual(4, f1.Points.Count);

			for (int i = 0; i < 4; i++)
			{
				Assert.AreEqual(points[i], f1.Points[i]);
			}
		}
		public void EqualityTest()
		{
			Point2D[] points1 = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };
			Point2D[] points2 = new Point2D[] { new Point2D(0, 0), new Point2D(2, 0), new Point2D(2, 2), new Point2D(0, 2) };
			Point2D[] points3 = new Point2D[] { new Point2D(0, 0), new Point2D(2, 0), new Point2D(2, 2), new Point2D(0, 2), new Point2D(0, 2) };

			GraphicsFigure2D f1 = new GraphicsFigure2D(points1, true);
			GraphicsFigure2D f2 = new GraphicsFigure2D(points1, true);
			GraphicsFigure2D f3 = new GraphicsFigure2D(points1);
			GraphicsFigure2D f4 = new GraphicsFigure2D(points2, true);
			GraphicsFigure2D f5 = new GraphicsFigure2D(points3, true);

			Assert.AreEqual(f1, f2);
			Assert.AreNotEqual(f1, f3);
			Assert.AreNotEqual(f1, f4);
			Assert.AreNotEqual(f4, f5);
			Assert.IsFalse(f1.Equals(new object()));
			f2 = null;
			Assert.IsFalse(f1.Equals(f2));
		}
		public void CurrentFigureTest1()
		{
			Point2D[] points = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };

			GraphicsFigure2D f1 = new GraphicsFigure2D(points, true);
			GraphicsPath2D p1 = new GraphicsPath2D(f1);

			f1 = p1.CurrentFigure as GraphicsFigure2D;
			Assert.AreEqual(4, p1.Points.Count);

			p1.NewFigure(points, false);
			Assert.AreSame(p1.CurrentFigure, p1.Figures[1]);

			p1.CurrentFigure = f1;
			Assert.AreSame(p1.CurrentFigure, f1);

			GraphicsPath2D p2 = new GraphicsPath2D();
			Assert.IsNull(p2.CurrentFigure);
			Assert.AreEqual(0, p2.Points.Count);
		}
		public void CreateNewTest()
		{
			GraphicsPath2D p1 = new GraphicsPath2D();
			Assert.AreEqual(0, p1.Figures.Count);

			Point2D[] points = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };
			GraphicsPath2D p2 = new GraphicsPath2D(points);
			Assert.AreEqual(1, p2.Figures.Count);
			Assert.AreEqual(4, p2.CurrentFigure.Points.Count);
			Assert.IsFalse(p2.CurrentFigure.IsClosed);

			GraphicsPath2D p3 = new GraphicsPath2D(points, true);
			Assert.IsTrue(p3.CurrentFigure.IsClosed);

			GraphicsFigure2D figure = new GraphicsFigure2D(points, true);
			GraphicsPath2D p4 = new GraphicsPath2D(new GraphicsFigure2D[] { figure });
			Assert.AreEqual(1, p4.Figures.Count);

			GraphicsPath2D p5 = new GraphicsPath2D(new GraphicsFigure2D[] { });
			Assert.IsNull(p5.CurrentFigure);
			Assert.AreEqual(0, p5.Points.Count);
		}
		public void EnumTest()
		{
			Point2D[] points1 = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };

			GraphicsFigure2D f1 = new GraphicsFigure2D(points1);

			IEnumerator e1 = (f1 as IEnumerable).GetEnumerator();

			Assert.IsNotNull(e1);
		}
		public void CurrentFigureTest2()
		{
			Point2D[] points = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };

			GraphicsFigure2D f1 = new GraphicsFigure2D(points, true);
			GraphicsPath2D p1 = new GraphicsPath2D();
			p1.NewFigure(points, false);

			p1.CurrentFigure = f1;
		}
		public void GetHashCodeTest()
		{
			Point2D[] points1 = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };
			GraphicsPath2D p1 = new GraphicsPath2D();
			GraphicsPath2D p2 = new GraphicsPath2D();
			GraphicsPath2D p3 = new GraphicsPath2D(points1);

			GraphicsFigure2D f1 = new GraphicsFigure2D(points1, true);
			GraphicsPath2D p4 = new GraphicsPath2D(points1, true);
			GraphicsPath2D p5 = new GraphicsPath2D(f1);

			Assert.AreEqual(p1.GetHashCode(), p2.GetHashCode());
			Assert.AreEqual(p4.GetHashCode(), p5.GetHashCode());
			Assert.AreNotEqual(p1.GetHashCode(), p3.GetHashCode());
			Assert.AreNotEqual(p3.GetHashCode(), p4.GetHashCode());
		}
		public void EqualityTest()
		{
			GraphicsPath2D p1 = new GraphicsPath2D();
			GraphicsPath2D p2 = new GraphicsPath2D();
			Assert.IsTrue(p1.Equals(p2));

			Point2D[] points1 = new Point2D[] { new Point2D(0, 0), new Point2D(1, 0), new Point2D(1, 1), new Point2D(0, 1) };
			Point2D[] points2 = new Point2D[] { new Point2D(0, 0), new Point2D(2, 0), new Point2D(2, 2), new Point2D(0, 2) };

			GraphicsPath2D p3 = new GraphicsPath2D(points1);
			GraphicsPath2D p4 = new GraphicsPath2D(points1);
			Assert.IsTrue(p3.Equals(p4));

			GraphicsPath2D p5 = new GraphicsPath2D(p3.CurrentFigure);
			Assert.IsTrue(p3.Equals(p5));

			GraphicsPath2D p6 = new GraphicsPath2D(points1, true);
			Assert.IsFalse(p3.Equals(p6));

			GraphicsFigure2D f1 = new GraphicsFigure2D(points1, false);
			GraphicsPath2D p7 = new GraphicsPath2D(new GraphicsFigure2D[] { f1 });
			Assert.IsTrue(p3.Equals(p7));

			GraphicsFigure2D f2 = new GraphicsFigure2D(points2, true);
			GraphicsPath2D p8 = new GraphicsPath2D(new GraphicsFigure2D[] { f1, f2 });
			Assert.IsFalse(p3.Equals(p8));

			p3.NewFigure(points2, true);
			Assert.IsTrue(p8.Equals(p3));

			p8 = null;
			Assert.IsFalse(p3.Equals(p8));
			Assert.IsFalse(p3.Equals(new object()));
		}