Ejemplo n.º 1
0
        public void GrowInnerArray_DeletedObjectsCleaned()
        {
            var odDictionaryChild = new ODDictionaryChild <String, String>();

            odDictionaryChild.InnerArray[5]           = new ODDictionaryNode <string, string>("Key", "Value");
            odDictionaryChild.InnerArray[6]           = new ODDictionaryNode <string, string>("Key1", "Value1");
            odDictionaryChild.InnerArray[7]           = new ODDictionaryNode <string, string>("Key2", "Value2");
            odDictionaryChild.InnerArray[7].IsDeleted = true;
            odDictionaryChild.GrowInnerArray();
            Assert.IsNull(odDictionaryChild.InnerArray.FirstOrDefault(filter => (filter != null && filter.Key.Equals("Key2"))));
        }
Ejemplo n.º 2
0
        public void GrowInnerArray_NotDeletedObjectsStillPresent()
        {
            var odDictionaryChild = new ODDictionaryChild <String, String>();

            odDictionaryChild.InnerArray[5]           = new ODDictionaryNode <string, string>("Key", "Value");
            odDictionaryChild.InnerArray[6]           = new ODDictionaryNode <string, string>("Key1", "Value1");
            odDictionaryChild.InnerArray[7]           = new ODDictionaryNode <string, string>("Key2", "Value2");
            odDictionaryChild.InnerArray[7].IsDeleted = true;
            odDictionaryChild.GrowInnerArray();
            Assert.AreEqual("Value", odDictionaryChild["Key"]);
            Assert.AreEqual("Value1", odDictionaryChild["Key1"]);
        }
Ejemplo n.º 3
0
        public void GrowInnerArray_SizeIncreased()
        {
            var odDictionaryChild = new ODDictionaryChild <String, String>();

            odDictionaryChild.InnerArray[5]           = new ODDictionaryNode <string, string>("Key", "Value");
            odDictionaryChild.InnerArray[6]           = new ODDictionaryNode <string, string>("Key1", "Value");
            odDictionaryChild.InnerArray[7]           = new ODDictionaryNode <string, string>("Key2", "Value2");
            odDictionaryChild.InnerArray[7].IsDeleted = true;
            int oldSize = odDictionaryChild.InnerArray.Length;

            odDictionaryChild.GrowInnerArray();
            Assert.IsTrue(odDictionaryChild.InnerArray.Length > oldSize);
        }