Пример #1
0
        public void ListViewSubItemCollection_IndexOf_Empty_ReturnsFalse()
        {
            var item       = new ListViewItem();
            var collection = new ListViewItem.ListViewSubItemCollection(item);

            Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem()));
            Assert.Equal(-1, collection.IndexOf(null));
        }
Пример #2
0
        public void ListViewSubItemCollection_IListIndexOf_Empty_ReturnsMinusOne()
        {
            var   item       = new ListViewItem();
            IList collection = new ListViewItem.ListViewSubItemCollection(item);

            Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem()));
            Assert.Equal(-1, collection.IndexOf(new object()));
            Assert.Equal(-1, collection.IndexOf(null));
        }
Пример #3
0
        public void ListViewSubItemCollection_IndexOf_Invoke_ReturnsExpected()
        {
            var item       = new ListViewItem();
            var collection = new ListViewItem.ListViewSubItemCollection(item);
            var subItem    = new ListViewItem.ListViewSubItem();

            collection.Add(subItem);

            Assert.Equal(0, collection.IndexOf(subItem));
            Assert.Equal(-1, collection.IndexOf(new ListViewItem.ListViewSubItem()));
            Assert.Equal(-1, collection.IndexOf(null));
        }