Example #1
0
        public void BrowsablePointer_IndexIsNullForEmptyCollection()
        {
            var list    = new BrowsableCollectionMock();
            var pointer = new BrowsablePointer(list, 0);

            Assert.AreEqual(0, pointer.Index);
            Assert.IsNull(pointer.Current);
        }
Example #2
0
        public void BrowsablePointer_IndexPointsToFirstItem()
        {
            var list    = new BrowsableCollectionMock(photo1);
            var pointer = new BrowsablePointer(list, 0);

            Assert.AreEqual(0, pointer.Index);
            Assert.AreEqual(photo1, pointer.Current);
        }
Example #3
0
        public void BrowsablePointer_PointsToSecond_WhenThirdIsDeleted()
        {
            var list    = new BrowsableCollectionMock(photo1, photo2, photo3);
            var pointer = new BrowsablePointer(list, 2);

            list.RemoveAt(2);
            Assert.AreEqual(1, pointer.Index);
            Assert.AreEqual(photo2, pointer.Current);
        }
Example #4
0
        public void BrowsablePointerTest_IndexIsOutOfBounds()
        {
            var list    = new BrowsableCollectionMock(photo1);
            var pointer = new BrowsablePointer(list, 1);

            // should this be fixed?
            Assert.AreEqual(1, pointer.Index);
            Assert.IsNull(pointer.Current);
        }
Example #5
0
        public void BrowsablePointer_StillPointsToSecond_WhenFirstIsDeleted()
        {
            var list    = new BrowsableCollectionMock(photo1, photo2, photo3);
            var pointer = new BrowsablePointer(list, 1);

            list.RemoveAt(0);
            Assert.AreEqual(0, pointer.Index);
            Assert.AreEqual(photo2, pointer.Current);
        }