Exemplo n.º 1
0
        public void Collections_List_Insert()
        {
            ReadList.AssertEmpty();

            var item1 = CreateItem1();
            var item2 = CreateItem2();

            WriteList.Add(item1);
            WriteList.Insert(0, item2);

            ReadList.AssertSequence(item2, item1);
        }
Exemplo n.º 2
0
        public void Collections_List_Order()
        {
            var item1 = CreateItem1();
            var item2 = CreateItem2();

            WriteList.Add(item1);
            WriteList.Add(item2);

            Assert.AreEqual(item1, ReadList[0]);
            Assert.AreEqual(item2, ReadList[1]);

            ReadList.AssertSequence(item1, item2);
        }
Exemplo n.º 3
0
        public void Collections_List_IndexOf()
        {
            var item1 = CreateItem1();
            var item2 = CreateItem2();
            var item3 = CreateItem3();

            WriteList.Add(item1);
            WriteList.Add(item2);

            Assert.AreEqual(0, ReadList.IndexOf(item1));
            Assert.AreEqual(1, ReadList.IndexOf(item2));
            Assert.AreEqual(-1, ReadList.IndexOf(item3));
        }
Exemplo n.º 4
0
        public void Collections_List_SetItem()
        {
            var item1 = CreateItem1();
            var item2 = CreateItem2();
            var item3 = CreateItem3();

            WriteList.Add(item1);
            WriteList.Add(item2);

            WriteList[1] = item3;

            Assert.AreEqual(item1, ReadList[0]);
            Assert.AreEqual(item3, ReadList[1]);
            Assert.IsFalse(ReadList.Contains(item2));
            ReadList.AssertSequence(item1, item3);
        }