Ejemplo n.º 1
0
        public void MergeWithNonCompatibleParentType()
        {
            ManagedList child = new ManagedList();

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

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

            child.Add("one");
            child.MergeEnabled = true;
            child.Merge("hello");
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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'");
        }
Ejemplo n.º 7
0
        public void MergeNotAllowedWhenMergeNotEnabled()
        {
            ManagedList child = new ManagedList();

            child.Merge(null);
        }