Exemplo n.º 1
0
        public void ArraySnip()
        {
            ArrayList arrayList = new ArrayList();
            arrayList.Add(new BELInteger(0));
            arrayList.Add(new BELInteger(1));
            arrayList.Add(new BELInteger(2));
            arrayList.Add(new BELInteger(3));

            BELArray original = new BELArray(arrayList);

            BELArray snipped = original.Snip(2);

            Assert.AreEqual(4, original.Count, "Checking that the length was preserved.");
            Assert.AreEqual(2, snipped.Count, "Checking that the snipped length was correct.");
            Assert.AreEqual(0, ((BELInteger) snipped.Item(0)).Value, "Checking that the contents of the snipped array are correct.");
            Assert.AreEqual(1, ((BELInteger) snipped.Item(1)).Value, "Checking that the contents of the snipped array are correct.");
        }