1 write to _collection
System.Windows.Forms.Tests (1)
System\Windows\Forms\DataGridViewComboBoxCell.ObjectCollectionTests.cs (1)
18
_collection
= new(_comboBoxCell);
89 references to _collection
System.Windows.Forms.Tests (89)
System\Windows\Forms\DataGridViewComboBoxCell.ObjectCollectionTests.cs (89)
24
_collection
.Count.Should().Be(0);
26
int index1 =
_collection
.Add("Item1");
27
int index2 =
_collection
.Add("Item2");
28
_collection
.Count.Should().Be(2);
32
_collection
.Remove("Item1");
33
_collection
.Count.Should().Be(1);
34
_collection
[0].Should().Be("Item2");
36
_collection
.Add("Item1");
37
_collection
.Remove("Item2");
38
_collection
.Count.Should().Be(1);
39
_collection
[0].Should().Be("Item1");
41
_collection
.Clear();
42
_collection
.Count.Should().Be(0);
47
_collection
.IsReadOnly.Should().BeFalse();
56
_collection
.Add(item1);
57
int index =
_collection
.Add(item2);
60
_collection
.Count.Should().Be(2);
61
_collection
[0].Should().Be(item2);
62
_collection
[1].Should().Be(item1);
68
Action action = () =>
_collection
.Add(null!);
78
_collection
.AddRange(items);
80
_collection
.Count.Should().Be(3);
81
_collection
[0].Should().Be("Item1");
82
_collection
[1].Should().Be("Item2");
83
_collection
[2].Should().Be("Item3");
92
_collection
.AddRange(items);
94
_collection
.Count.Should().Be(3);
95
_collection
[0].Should().Be("A");
96
_collection
[1].Should().Be("B");
97
_collection
[2].Should().Be("C");
105
_collection
.AddRange(items);
107
_collection
.InnerArray.Count.Should().Be(3);
108
_collection
[0].Should().Be("Item1");
109
_collection
[1].Should().Be("Item2");
110
_collection
[2].Should().Be("Item3");
118
Action action = () =>
_collection
.AddRange(items);
121
_collection
.Count.Should().Be(0);
129
_collection
.Add(item1);
130
_collection
.Add(item2);
132
_collection
[0].Should().Be(item1);
133
_collection
[1].Should().Be(item2);
141
_collection
.Add(item1);
143
_collection
[0] = item2;
145
_collection
[0].Should().Be(item2);
153
Action action = () =>
_collection
[index] = "Item";
161
_collection
.Add("Item");
163
Action action = () =>
_collection
[0] = null!;
173
_collection
.Add("Item1");
174
_collection
.Add("Item2");
176
_collection
.Clear();
178
_collection
.Count.Should().Be(0);
187
_collection
.Add(item);
189
_collection
.Contains(item).Should().BeTrue();
190
_collection
.Contains("NonExistentItem").Should().BeFalse();
196
Action action = () =>
_collection
.Contains(null!);
205
_collection
.AddRange(items);
208
_collection
.CopyTo(destination, 0);
218
Action actionNullDestination = () =>
_collection
.CopyTo(null!, 0);
222
Action actionNegativeIndex = () =>
_collection
.CopyTo(destination, -1);
225
Action actionOutOfRangeIndex = () =>
_collection
.CopyTo(destination, 4);
233
_collection
.AddRange(items);
236
Action action = () =>
_collection
.CopyTo(destination, 0);
245
_collection
.AddRange(items);
247
var enumerator =
_collection
.GetEnumerator();
264
_collection
.Add(item1);
265
_collection
.Add(item2);
267
_collection
.IndexOf(item1).Should().Be(0);
268
_collection
.IndexOf(item2).Should().Be(1);
269
_collection
.IndexOf("NonExistentItem").Should().Be(-1);
275
Action action = () =>
_collection
.IndexOf(null!);
286
_collection
.Add(item1);
287
_collection
.Insert(0, item2);
291
_collection
[0].Should().Be(item2);
292
_collection
[1].Should().Be(item1);
296
_collection
[0].Should().Be(item2);
297
_collection
[1].Should().Be(item1);
307
Action actionNegativeIndex = () =>
_collection
.Insert(-1, "Item");
308
Action actionOutOfRangeIndex = () =>
_collection
.Insert(1, "Item");
309
Action actionNullItem = () =>
_collection
.Insert(0, null!);
321
_collection
.Add(item1);
323
_collection
.Remove(item2);
325
_collection
.Count.Should().Be(1);
326
_collection
[0].Should().Be(item1);
334
_collection
.Add(item1);
335
_collection
.Add(item2);
337
_collection
.RemoveAt(0);
339
_collection
.Count.Should().Be(1);
340
_collection
[0].Should().Be(item2);
348
Action action = () =>
_collection
.RemoveAt(index);