public static int[] runit( )
            {
                int[] intarray = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
                //instantiate generic with Integer
                CollectionTestClass <int> intObj = new CollectionTestClass <int> ( );

                //adding integer values into collection
                intObj.Add(1);
                intObj.Add(2);
                intObj.Add(3);                      //No boxing
                intObj.Add(4);
                intObj.Add(5);
                intObj.Add(6);
                intObj.Add(7);
                intObj.Add(8);
                intObj.Add(9);
                intObj.Add(10);

                //displaying values
                for (int i = 0; i < intObj.count; i++)
                {
                    intarray[i] = intObj[i];
                }
                return(intarray);
            }
示例#2
0
        public void WriteCollectionTestClassContainingNulls()
        {
            string xml = NetReflector.Write(CollectionTestClass.CreateCollectionContainingNulls());

            Assert.AreEqual(CollectionTestClass.GetXmlWithMissingNullElements(), xml);
        }
示例#3
0
        public void ReadCollectionTestClass()
        {
            CollectionTestClass actual = (CollectionTestClass)NetReflector.Read(CollectionTestClass.GetXml(), table);

            CollectionTestClass.AssertEquals(CollectionTestClass.Create(), actual);
        }
示例#4
0
        public void WriteCollectionTestClass()
        {
            string xml = NetReflector.Write(CollectionTestClass.Create());

            Assert.AreEqual(CollectionTestClass.GetXml(), xml);
        }