Example #1
0
        public void Contains_ReturnFalseIfNoEmelentInArray()
        {
            NewList <int> list   = new NewList <int>();
            var           result = list.Contains(0);

            Assert.False(result);
        }
Example #2
0
 public void RegisterDirty(T obj)
 {
     if (!NewList.Contains(obj) && !RemovedList.Contains(obj))
     {
         DirtyList.Add(obj);
     }
     // Console.WriteLine("Updating: " + obj.ToBsonDocument()[0]);\
 }
Example #3
0
        public void Contains_ReturnTrueIfItemExistsInArray()
        {
            NewList <int> list = new NewList <int> {
                1, 2
            };
            var result = list.Contains(1);

            Assert.True(result);
        }
Example #4
0
        public void RegisterRemoved(T obj)
        {
            // remove from dirty list (nothing will happen even if the obj not inside the dirty list)
            DirtyList.Remove(obj);

            if (NewList.Contains(obj))
            {
                // if obj is newly created, not yet saved in db, then just remove it from new list
                NewList.Remove(obj);
            }
            else if (!RemovedList.Contains(obj))
            {
                // only add obj into removed list if its not already inside
                RemovedList.Add(obj);
            }
        }