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

            child.Add("one");
            child.MergeEnabled = true;
            Assert.Throws <InvalidOperationException>(() => child.Merge("hello"));
        }
Exemplo n.º 2
0
        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");
        }
Exemplo 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);
        }
Exemplo 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);
        }
Exemplo 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'");
        }
        public void MergeNotAllowedWhenMergeNotEnabled()
        {
            ManagedList child = new ManagedList();

            child.Merge(null);
        }