コード例 #1
0
        public void RemoveAt_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.RemoveAt(position);
        }
コード例 #2
0
        public void RemoveAt_RemovesElementPointsCountShouldDecrease(int position)
        {
            var polygon = new PolygonCore();
            polygon.Insert(0.1, 1.0);
            polygon.Insert(0.2, 1.1);
            polygon.Insert(0.3, 2.0);
            int i = polygon.Points.Count;

            polygon.RemoveAt(position);

            Assert.IsTrue(i - polygon.Points.Count == 1);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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]);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        public void RemoveAt_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.RemoveAt(1);

            Assert.IsTrue(polygon.CurrentPoint == null);
        }