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

TryListViewAsSCIList1() публичный Метод

public TryListViewAsSCIList1 ( IList mylist ) : void
mylist IList
Результат void
        void TryListViewAsSCIList1(IList<B> mylist)
        {
            B b1_ = new B(), b2_ = new B();
              C c1_ = new C(), c2_ = new C();
              mylist.AddAll(new B[] { new B(), b1_, b2_, c1_, new B() });
              System.Collections.IList list = mylist.View(1, 3);
              Object b1 = b1_, b2 = b2_, c1 = c1_, c2 = c2_;
              // Should be called with a three-element view on ArrayList<B>
              Assert.AreEqual(3, list.Count);
              Assert.IsFalse(list.IsSynchronized);
              Assert.AreNotEqual(null, list.SyncRoot);
              Assert.AreEqual(list.SyncRoot, 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));
        }