Пример #1
0
 public object read_boxed(BoxedValueAttribute attr, Type boxedType, AttributeExtCollection boxedTypeAttrs)
 {
     if (boxedTypeAttrs == null)
     {
         boxedTypeAttrs = AttributeExtCollection.EmptyCollection;
     }
     boxedTypeAttrs = boxedTypeAttrs.MergeAttribute(attr);
     return(Unmarshal(boxedType, boxedTypeAttrs, m_cdrIn));
 }
Пример #2
0
        public void TestMergeAttribute()
        {
            TestAttributeForCollT1 a1 = new TestAttributeForCollT1(1);
            TestAttributeForCollT2 a2 = new TestAttributeForCollT2(2);
            TestAttributeForCollT3 a3 = new TestAttributeForCollT3(3);
            TestAttributeForCollT4 a4 = new TestAttributeForCollT4(4);
            TestAttributeForCollT5 a5 = new TestAttributeForCollT5(5);

            AttributeExtCollection testColl1 =
                AttributeExtCollection.ConvertToAttributeCollection(new object[] { a1, a2, a3, a4 });

            AttributeExtCollection merged1 = testColl1.MergeAttribute(a5);

            Assert.AreEqual(a5, merged1.GetAttributeAt(0), "wrong merged");
            Assert.AreEqual(a1, merged1.GetAttributeAt(1), "wrong merged");
            Assert.AreEqual(a2, merged1.GetAttributeAt(2), "wrong merged");
            Assert.AreEqual(a3, merged1.GetAttributeAt(3), "wrong merged");
            Assert.AreEqual(a4, merged1.GetAttributeAt(4), "wrong merged");
            Assert.AreEqual(5, merged1.Count, "result length");
        }