Example #1
0
        public void TestSomePairs()
        {
            var map = new CoreNodeIdMap();

            map.Add(1, 10);
            map.Add(1, 11);
            map.Add(2, 20);
            map.Add(3, 30);
            map.Add(3, 31);
            map.Add(3, 32);
            map.Add(4, 40);

            Assert.AreEqual(3, map.MaxVerticePerNode());
            var result = new uint[10];

            Assert.AreEqual(2, map.Get(1, ref result));
            Assert.AreEqual(10, result[0]);
            Assert.AreEqual(11, result[1]);
            Assert.AreEqual(1, map.Get(2, ref result));
            Assert.AreEqual(20, result[0]);
            Assert.AreEqual(3, map.Get(3, ref result));
            Assert.AreEqual(30, result[0]);
            Assert.IsTrue(result[1] == 31 || result[1] == 32);
            Assert.IsTrue(result[2] == 31 || result[2] == 32);
            Assert.AreEqual(1, map.Get(4, ref result));
            Assert.AreEqual(40, result[0]);
        }
Example #2
0
        public void TestOnePair()
        {
            var map = new CoreNodeIdMap();

            map.Add(1, 10);

            Assert.AreEqual(1, map.MaxVerticePerNode());
            var result = new uint[10];

            Assert.AreEqual(1, map.Get(1, ref result));
            Assert.AreEqual(10, result[0]);
        }