public void MergeWithNonCompatibleParentType()
        {
            ManagedList child = new ManagedList();

            child.Add("one");
            child.MergeEnabled = true;
            Assert.Throws <InvalidOperationException>(() => child.Merge("hello"));
        }
        public void MergeWithNullParent()
        {
            ManagedList child = new ManagedList();

            child.Add("one");
            child.MergeEnabled = true;
            Assert.AreSame(child, child.Merge(null));
        }
        public void MergeWithNonCompatibleParentType()
        {
            ManagedList child = new ManagedList();

            child.Add("one");
            child.MergeEnabled = true;
            child.Merge("hello");
        }
        public void MergeEmptyChild()
        {
            ManagedList parent = new ManagedList();

            parent.Add("one");
            parent.Add("two");
            ManagedList child = new ManagedList();

            child.MergeEnabled = true;
            IList mergedList = (IList)child.Merge(parent);

            Assert.AreEqual(2, mergedList.Count);
        }
        public void MergeChildValueOverrideTheParents()
        {
            //doesn't make much sense in the context of a list...
            ManagedList parent = new ManagedList();

            parent.Add("one");
            parent.Add("two");
            ManagedList child = new ManagedList();

            child.Add("one");
            child.MergeEnabled = true;
            IList mergedList = (IList)child.Merge(parent);

            Assert.AreEqual(3, mergedList.Count);
        }
        public void MergeNotAllowedWhenMergeNotEnabled()
        {
            ManagedList child = new ManagedList();

            Assert.Throws <InvalidOperationException>(() => child.Merge(null), "Not allowed to merge when the 'MergeEnabled' property is set to 'false'");
        }
        public void MergeNotAllowedWhenMergeNotEnabled()
        {
            ManagedList child = new ManagedList();

            child.Merge(null);
        }