예제 #1
0
            public ArrayEnumerator(MyIntArray myIntArray)

            {
                this.myIntArray = myIntArray;

                index = -1;
            }
예제 #2
0
            public ArrayEnumerator(MyIntArray myIntArray) 

            {

                this.myIntArray = myIntArray;

                index = -1;

            }
 public void TestMyIntArray()
 {
     int[] items = new int[6] {2,4,6,8,10,12};
     MyIntArray myIntArray = new MyIntArray(items);
     //Now we can use foreach to iterate through the array
     foreach(int i in myIntArray)
     {
         Assert.IsTrue(i % 2 == 0);
         Assert.IsTrue(i > 0);
         Assert.IsTrue(i <= 12);
     }
 }