public void TestInsertCoordinates()
        {
            var buf = new CoordinateBuffer();
            Assert.IsTrue(buf.AddCoordinate(0, 0));
            
            Assert.IsTrue(buf.AddCoordinate(10, 10));
            Assert.AreEqual(2, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);

            Assert.IsTrue(buf.InsertCoordinate(0, -10d, -10d));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);
            
            Assert.IsTrue(buf.InsertCoordinate(0, -10d, -10d));
            Assert.AreEqual(4, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);
        }
Example #2
0
        public void TestInsertCoordinates()
        {
            var buf = new CoordinateBuffer();

            Assert.IsTrue(buf.AddCoordinate(0, 0));

            Assert.IsTrue(buf.AddCoordinate(10, 10));
            Assert.AreEqual(2, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);

            Assert.IsTrue(buf.InsertCoordinate(0, -10d, -10d));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);

            Assert.IsTrue(buf.InsertCoordinate(0, -10d, -10d));
            Assert.AreEqual(4, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);
        }
        public void TestInsertCoordinatesDisallowRepeated()
        {
            var buf = new CoordinateBuffer();
            Assert.IsTrue(buf.AddCoordinate(0, 0));
            
            Assert.IsTrue(buf.AddCoordinate(10, 10));
            Assert.IsTrue(buf.InsertCoordinate(0, -10d, -10d, allowRepeated: false));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);

            Assert.IsFalse(buf.InsertCoordinate(0, -10d, -10d, allowRepeated: false));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);

            Assert.IsFalse(buf.InsertCoordinate(1, -10d, -10d, allowRepeated: false));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);
        }
Example #4
0
        public void TestInsertCoordinatesDisallowRepeated()
        {
            var buf = new CoordinateBuffer();

            Assert.IsTrue(buf.AddCoordinate(0, 0));

            Assert.IsTrue(buf.AddCoordinate(10, 10));
            Assert.IsTrue(buf.InsertCoordinate(0, -10d, -10d, allowRepeated: false));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);

            Assert.IsFalse(buf.InsertCoordinate(0, -10d, -10d, allowRepeated: false));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);

            Assert.IsFalse(buf.InsertCoordinate(1, -10d, -10d, allowRepeated: false));
            Assert.AreEqual(3, buf.Count);
            CheckDefinedFlags(buf, Ordinates.XY);
        }