Exemple #1
0
        public void ListViewGroupCollection_IndexOf_Empty_ReturnsFalse()
        {
            using var listView = new ListView();
            ListViewGroupCollection collection = listView.Groups;

            Assert.Equal(-1, collection.IndexOf(new ListViewGroup()));
            Assert.Equal(-1, collection.IndexOf(null));
        }
Exemple #2
0
        public void ListViewGroupCollection_IndexOf_Invoke_ReturnsExpected()
        {
            using var listView = new ListView();
            ListViewGroupCollection collection = listView.Groups;
            var group = new ListViewGroup();

            collection.Add(group);

            Assert.Equal(0, collection.IndexOf(group));
            Assert.Equal(-1, collection.IndexOf(new ListViewGroup()));
            Assert.Equal(-1, collection.IndexOf(null));
        }
        public void IndexOfTest()
        {
            ListViewGroup obj  = new ListViewGroup("Item1");
            ListViewGroup obj2 = new ListViewGroup("Item2");

            grpCol.Add(obj);
            grpCol.Add(obj2);
            Assert.AreEqual(1, grpCol.IndexOf(obj2), "#E1");
        }