public void RemoveCurrent_CurrentSet_RemovesCurrentSelectedPointShouldBeNull()
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);
            polygon.Select(1);

            polygon.RemoveCurrent();

            Assert.IsTrue(polygon.CurrentPoint == null); 
        }
        public void Select_ProperIndex_ShouldSelect(int position)
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);

            polygon.Select(position);
        }
        public void Select_ProperIndex_ShouldSelectProperPointIndex()
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);

            polygon.Select(1);

            Assert.IsTrue(polygon.CurrentPointIndex == 1);
        }
        public void Select_InvalidIndex_ThrowsException(int position)
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);

            polygon.Select(position);
        }
        public void RemoveAt_RemovesElementPointAtPositionIndexShouldChange()
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);
            polygon.Select(1);
            int positionBefore = polygon.CurrentPointIndex;

            polygon.RemoveAt(0);

            Assert.IsTrue(positionBefore != polygon.CurrentPointIndex);
        }
        public void RemoveAt_RemovesElementPointAtPositionShouldChange()
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);
            polygon.Select(1);
            var pointAt1 = polygon.Points[1];

            polygon.RemoveAt(1);

            Assert.IsTrue(pointAt1 != polygon.Points[1]);
        }
        public void RemoveAt_RemovesCurrentSelectedPointIndexShouldBeMinusOne()
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);
            polygon.Select(1);

            polygon.RemoveAt(1);

            Assert.IsTrue(polygon.CurrentPointIndex == -1);
        }
        public void RemoveCurrent_CurrentSet_RemovesCurrentSelectedPointsCountShouldDecrease()
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);
            polygon.Select(1);
            int i = polygon.Points.Count;

            polygon.RemoveCurrent();

            Assert.IsTrue(i - polygon.Points.Count == 1);
        }