C5UnitTests.interfaces.SCIListTests.TryViewOfGuardedListAsSCIList1 C# (CSharp) Метод

TryViewOfGuardedListAsSCIList1() приватный Метод

private TryViewOfGuardedListAsSCIList1 ( ) : void
Результат void
        public void TryViewOfGuardedListAsSCIList1()
        {
            B b1_ = new B(), b2_ = new B();
              C c1_ = new C(), c2_ = new C();
              ArrayList<B> mylist = new ArrayList<B>();
              mylist.AddAll(new B[] { new B(), b1_, b2_, c1_, new B()});
              System.Collections.IList list = new GuardedList<B>(mylist).View(1, 3);
              Object b1 = b1_, b2 = b2_, c1 = c1_, c2 = c2_;
              // Should be called with a three-element view of a GuardedList<B>
              Assert.AreEqual(3, list.Count);
              Assert.IsTrue(list.IsFixedSize);
              Assert.IsTrue(list.IsReadOnly);
              Assert.IsFalse(list.IsSynchronized);
              Assert.AreNotEqual(null, list.SyncRoot);
              Assert.AreEqual(list.SyncRoot, ((System.Collections.IList)mylist).SyncRoot);
              Assert.IsTrue(list.Contains(b1));
              Assert.IsTrue(list.Contains(b2));
              Assert.IsTrue(list.Contains(c1));
              Assert.IsFalse(list.Contains(c2));
              Array arrA = new A[3], arrB = new B[3];
              list.CopyTo(arrA, 0);
              list.CopyTo(arrB, 0);
              Assert.AreEqual(b1, arrA.GetValue(0));
              Assert.AreEqual(b1, arrB.GetValue(0));
              Assert.AreEqual(b2, arrA.GetValue(1));
              Assert.AreEqual(b2, arrB.GetValue(1));
              Assert.AreEqual(0, list.IndexOf(b1));
              Assert.AreEqual(-1, list.IndexOf(c2));
        }