Пример #1
0
        public void FirstAvailable_LocationUnoccupied()
        {
            var  odDictionaryChild = new ODDictionaryChild <String, String>();
            bool keyAlreadyPresent;
            int  keyLocation = odDictionaryChild.FirstAvailable(5, "Key", out keyAlreadyPresent);

            Assert.IsFalse(keyAlreadyPresent);
            Assert.AreEqual(5, keyLocation);
        }
Пример #2
0
        public void FirstAvailable_AlreadyPresent()
        {
            var  odDictionaryChild = new ODDictionaryChild <String, String>();
            bool keyAlreadyPresent;

            odDictionaryChild.InnerArray[5] = new ODDictionaryNode <string, string>("Key", "Value");
            int keyLocation = odDictionaryChild.FirstAvailable(5, "Key", out keyAlreadyPresent);

            Assert.IsTrue(keyAlreadyPresent);
            Assert.AreEqual(5, keyLocation);
        }
Пример #3
0
        public void FirstAvailable_LocationOccupiedWithDeletedSelfKey()
        {
            var  odDictionaryChild = new ODDictionaryChild <String, String>();
            bool keyAlreadyPresent;

            odDictionaryChild.InnerArray[5]           = new ODDictionaryNode <string, string>("Key", "Value");
            odDictionaryChild.InnerArray[5].IsDeleted = true;
            int keyLocation = odDictionaryChild.FirstAvailable(5, "Key", out keyAlreadyPresent);

            Assert.IsFalse(keyAlreadyPresent);
            Assert.AreEqual(5, keyLocation);
        }