Beispiel #1
0
        public void AdjustToCapacity(int nodeCount, int padToCount, int expectedCount)
        {
            string defaultVal = "";
            _Net = new BasicAdjList(Guid.NewGuid());
            for (int i = 0; i < nodeCount; i++)     // set capacity
                _Net.CreateNode();

            _Mgr = new DataAttributeMgr(AttributeListMgrFixture.NODE_ATTRIB_LIST, _Net);

            AttributeList<string> list = new AttributeList<string>(_Mgr, defaultVal, "test list");

            Assert.AreEqual(nodeCount, list.Count, "list.Count should be nodeCount");

            list.AdjustToCapacity(padToCount);

            Assert.AreEqual(expectedCount, list.Count, "list.Count should match expected");

            for (int i = 0; i < list.Count; i++)
            {
                Assert.AreEqual(defaultVal, list[i], string.Format("list[{0}] should match expected", i));
            }
        }