Пример #1
0
        public void ListViewGroupCollection_Contains_Empty_ReturnsFalse()
        {
            using var listView = new ListView();
            ListViewGroupCollection collection = listView.Groups;

            Assert.False(collection.Contains(new ListViewGroup()));
            Assert.False(collection.Contains(null));
        }
        public void ContainsTest()
        {
            ListViewGroup obj  = new ListViewGroup("Item1");
            ListViewGroup obj2 = new ListViewGroup("Item2");

            grpCol.Add(obj);
            Assert.AreEqual(true, grpCol.Contains(obj), "#D1");
            Assert.AreEqual(false, grpCol.Contains(obj2), "#D2");
        }
Пример #3
0
        public void ListViewGroupCollection_Contains_Invoke_ReturnsExpected()
        {
            using var listView = new ListView();
            ListViewGroupCollection collection = listView.Groups;
            var group = new ListViewGroup();

            collection.Add(group);

            Assert.True(collection.Contains(group));
            Assert.False(collection.Contains(new ListViewGroup()));
            Assert.False(collection.Contains(null));
        }