8000 Handle FeedBacks · dotnet/winforms@cc63bc6 · GitHub
[go: up one dir, main page]

Skip to content

Commit cc63bc6

Browse files
Zheng-Li01Tanya-Solyanik
authored andcommitted
Handle FeedBacks
1 parent c1a7dfb commit cc63bc6

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

src/System.Windows.Forms/tests/UnitTests/System/Windows/Forms/ListBox.SelectedObjectCollectionTests.cs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,15 @@ public ListBoxSelectedObjectCollectionTests()
1919
}
2020

2121
public void Dispose()
22-
{
23-
_owner.Dispose();
24-
}
22+
=> _owner.Dispose();
2523

2624
[Fact]
27-
public void ListBoxSelectedObjectCollection_Ctor_ListBox() =>
28-
Assert.True(_collection.IsReadOnly);
25+
public void ListBoxSelectedObjectCollection_Ctor_ListBox()
26+
=> Assert.True(_collection.IsReadOnly);
2927

3028
[Fact]
31-
public void ListBoxSelectedObjectCollection_Ctor_NullOwner_ThrowsArgumentNullException() =>
32-
Assert.Throws<ArgumentNullException>("owner", () => new ListBox.SelectedObjectCollection(null!));
29+
public void ListBoxSelectedObjectCollection_Ctor_NullOwner_ThrowsArgumentNullException()
30+
=> Assert.Throws<ArgumentNullException>("owner", () => new ListBox.SelectedObjectCollection(null!));
3331

3432
[Fact]
3533
public void ListBoxSelectedObjectCollection_ICollection_Properties_GetReturnsExpected()
@@ -57,19 +55,19 @@ public void ListBoxSelectedObjectCollection_IList_Properties_GetReturnsExpected(
5755
[InlineData(-1, "1")]
5856
[InlineData(0, "1")]
5957
[InlineData(1, "1")]
60-
public void ListBoxSelectedObjectCollection_IListItem_Set_ThrowsNotSupportedException(int index, object value) =>
61-
Assert.Throws<NotSupportedException>(() => ((IList)_collection)[index] = value);
58+
public void ListBoxSelectedObjectCollection_IListItem_Set_ThrowsNotSupportedException(int index, object value)
59+
=> Assert.Throws<NotSupportedException>(() => ((IList)_collection)[index] = value);
6260

6361
[Theory]
6462
[InlineData(0)]
6563
[InlineData(1)]
6664
[InlineData("1")]
67-
public void ListBoxSelectedObjectCollection_IListAdd_Invoke_ThrowsNotSupportedException(object value) =>
68-
Assert.Throws<NotSupportedException>(() => ((IList)_collection).Add(value));
65+
public void ListBoxSelectedObjectCollection_IListAdd_Invoke_ThrowsNotSupportedException(object value)
66+
=> Assert.Throws<NotSupportedException>(() => ((IList)_collection).Add(value));
6967

7068
[Fact]
71-
public void ListBoxSelectedObjectCollection_IListClear_Invoke_ThrowsNotSupportedException() =>
72-
Assert.Throws<NotSupportedException>(() => ((IList)_collection).Clear());
69+
public void ListBoxSelectedObjectCollection_IListClear_Invoke_ThrowsNotSupportedException()
70+
=> Assert.Throws<NotSupportedException>(() => ((IList)_collection).Clear());
7371

7472
[Theory]
7573
[InlineData(-1, 0)]
@@ -81,22 +79,22 @@ public void ListBoxSelectedObjectCollection_IListClear_Invoke_ThrowsNotSupported
8179
[InlineData(-1, "1")]
8280
[InlineData(0, "1")]
8381
[InlineData(1, "1")]
84-
public void ListBoxSelectedObjectCollection_IListInsert_Invoke_ThrowsNotSupportedException(int index, object value) =>
85-
Assert.Throws<NotSupportedException>(() => ((IList)_collection).Insert(index, value));
82+
public void ListBoxSelectedObjectCollection_IListInsert_Invoke_ThrowsNotSupportedException(int index, object value)
83+
=> Assert.Throws<NotSupportedException>(() => ((IList)_collection).Insert(index, value));
8684

8785
[Theory]
8886
[InlineData(0)]
8987
[InlineData(1)]
9088
[InlineData("1")]
91-
public void ListBoxSelectedObjectCollection_IListRemove_Invoke_ThrowsNotSupportedException(object value) =>
92-
Assert.Throws<NotSupportedException>(() => ((IList)_collection).Remove(value));
89+
public void ListBoxSelectedObjectCollection_IListRemove_Invoke_ThrowsNotSupportedException(object value)
90+
=> Assert.Throws<NotSupportedException>(() => ((IList)_collection).Remove(value));
9391

9492
[Theory]
9593
[InlineData(-1)]
9694
[InlineData(0)]
9795
[InlineData(1)]
98-
public void ListBoxSelectedObjectCollection_IListRemoveAt_Invoke_ThrowsNotSupportedException(int index) =>
99-
Assert.Throws<NotSupportedException>(() => ((IList)_collection).RemoveAt(index));
96+
public void ListBoxSelectedObjectCollection_IListRemoveAt_Invoke_ThrowsNotSupportedException(int index)
97+
=> Assert.Throws<NotSupportedException>(() => ((IList)_collection).RemoveAt(index));
10098

10199
[Theory]
102100
[InlineData(0, false)]

0 commit comments

Comments
 (0)
0