1 write to _collection
System.Windows.Forms.Tests (1)
System\Windows\Forms\ListBox.SelectedObjectCollectionTests.cs (1)
16
_collection
= new(_owner);
32 references to _collection
System.Windows.Forms.Tests (32)
System\Windows\Forms\ListBox.SelectedObjectCollectionTests.cs (32)
24
=> Assert.True(
_collection
.IsReadOnly);
33
Assert.False(((ICollection)
_collection
).IsSynchronized);
34
Assert.Same(
_collection
, ((ICollection)
_collection
).SyncRoot);
40
Assert.True(((IList)
_collection
).IsFixedSize);
41
Assert.True(((IList)
_collection
).IsReadOnly);
42
Assert.False(((IList)
_collection
).IsSynchronized);
43
Assert.Same(
_collection
, ((IList)
_collection
).SyncRoot);
57
=> Assert.Throws<NotSupportedException>(() => ((IList)
_collection
)[index] = value);
64
=> Assert.Throws<NotSupportedException>(() => ((IList)
_collection
).Add(value));
68
=> Assert.Throws<NotSupportedException>(() => ((IList)
_collection
).Clear());
81
=> Assert.Throws<NotSupportedException>(() => ((IList)
_collection
).Insert(index, value));
88
=> Assert.Throws<NotSupportedException>(() => ((IList)
_collection
).Remove(value));
95
=> Assert.Throws<NotSupportedException>(() => ((IList)
_collection
).RemoveAt(index));
106
_collection
.Contains(value).Should().Be(expected);
118
_collection
.EnsureUpToDate();
119
_collection
.IndexOf(value).Should().Be(expected);
126
_collection
.CopyTo(destination, 0);
137
_collection
.CopyTo(destination, 0);
144
_collection
.Clear();
145
_collection
.Count.Should().Be(0);
154
_collection
.Clear();
155
_collection
.Count.Should().Be(0);
162
_collection
.Remove("item1");
163
_collection
.Count.Should().Be(0);
172
_collection
.Remove("item2");
173
_collection
.Count.Should().Be(0);
183
_collection
.Remove("item3");
184
_collection
.Count.Should().Be(1);
194
_collection
.Remove(null!);
195
_collection
.Count.Should().Be(1);