@@ -12,7 +12,7 @@ namespace CommunityToolkit.Mvvm.UnitTests.Collections;
1212public class Test_ObservableGroupedCollectionExtensions
1313{
1414 [ TestMethod ]
15- public void First_WhenGroupExists_ShouldReturnFirstGroup ( )
15+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupExists_ShouldReturnFirstGroup ( )
1616 {
1717 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
1818
@@ -29,7 +29,7 @@ public void First_WhenGroupExists_ShouldReturnFirstGroup()
2929
3030 [ TestMethod ]
3131 [ ExpectedException ( typeof ( InvalidOperationException ) ) ]
32- public void First_WhenGroupDoesNotExist_ShouldThrow ( )
32+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupDoesNotExist_ShouldThrow ( )
3333 {
3434 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
3535
@@ -39,7 +39,7 @@ public void First_WhenGroupDoesNotExist_ShouldThrow()
3939 }
4040
4141 [ TestMethod ]
42- public void FirstOrDefault_WhenGroupExists_ShouldReturnFirstGroup ( )
42+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKeyOrDefault_WhenGroupExists_ShouldReturnFirstGroup ( )
4343 {
4444 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
4545
@@ -55,7 +55,7 @@ public void FirstOrDefault_WhenGroupExists_ShouldReturnFirstGroup()
5555 }
5656
5757 [ TestMethod ]
58- public void FirstOrDefault_WhenGroupDoesNotExist_ShouldReturnNull ( )
58+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKeyOrDefault_WhenGroupDoesNotExist_ShouldReturnNull ( )
5959 {
6060 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
6161
@@ -67,7 +67,7 @@ public void FirstOrDefault_WhenGroupDoesNotExist_ShouldReturnNull()
6767 }
6868
6969 [ TestMethod ]
70- public void ElementAt_WhenGroupExistsAndIndexInRange_ShouldReturnFirstGroupValue ( )
70+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupExistsAndIndexInRange_ShouldReturnFirstGroupValue ( )
7171 {
7272 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
7373
@@ -84,7 +84,7 @@ public void ElementAt_WhenGroupExistsAndIndexInRange_ShouldReturnFirstGroupValue
8484 [ DataRow ( - 1 ) ]
8585 [ DataRow ( 3 ) ]
8686 [ ExpectedException ( typeof ( ArgumentOutOfRangeException ) ) ]
87- public void ElementAt_WhenGroupExistsAndIndexOutOfRange_ShouldReturnThrow ( int index )
87+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupExistsAndIndexOutOfRange_ShouldReturnThrow ( int index )
8888 {
8989 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
9090
@@ -96,18 +96,7 @@ public void ElementAt_WhenGroupExistsAndIndexOutOfRange_ShouldReturnThrow(int in
9696 }
9797
9898 [ TestMethod ]
99- [ ExpectedException ( typeof ( InvalidOperationException ) ) ]
100- public void ElementAt_WhenGroupDoesNotExist_ShouldThrow ( )
101- {
102- ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
103-
104- _ = groupedCollection . AddGroup ( "A" , new [ ] { 23 } ) ;
105-
106- _ = groupedCollection . FirstGroupByKey ( "I do not exist" ) [ 0 ] ;
107- }
108-
109- [ TestMethod ]
110- public void ElementAtOrDefault_WhenGroupExistsAndIndexInRange_ShouldReturnValue ( )
99+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupExistsAndIndexInRange_ShouldReturnValue ( )
111100 {
112101 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
113102
@@ -121,7 +110,7 @@ public void ElementAtOrDefault_WhenGroupExistsAndIndexInRange_ShouldReturnValue(
121110 }
122111
123112 [ TestMethod ]
124- public void AddGroup_WithItem_ShouldAddGroup ( )
113+ public void Test_ObservableGroupedCollectionExtensions_AddGroup_WithItem_ShouldAddGroup ( )
125114 {
126115 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
127116
@@ -134,7 +123,7 @@ public void AddGroup_WithItem_ShouldAddGroup()
134123 }
135124
136125 [ TestMethod ]
137- public void AddGroup_WithCollection_ShouldAddGroup ( )
126+ public void Test_ObservableGroupedCollectionExtensions_AddGroup_WithCollection_ShouldAddGroup ( )
138127 {
139128 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
140129
@@ -147,7 +136,7 @@ public void AddGroup_WithCollection_ShouldAddGroup()
147136 }
148137
149138 [ TestMethod ]
150- public void AddGroup_WithParamsCollection_ShouldAddGroup ( )
139+ public void Test_ObservableGroupedCollectionExtensions_AddGroup_WithParamsCollection_ShouldAddGroup ( )
151140 {
152141 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
153142
@@ -160,7 +149,7 @@ public void AddGroup_WithParamsCollection_ShouldAddGroup()
160149 }
161150
162151 [ TestMethod ]
163- public void AddItem_WhenTargetGroupDoesNotExists_ShouldCreateAndAddNewGroup ( )
152+ public void Test_ObservableGroupedCollectionExtensions_AddItem_WhenTargetGroupDoesNotExists_ShouldCreateAndAddNewGroup ( )
164153 {
165154 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
166155
@@ -173,7 +162,7 @@ public void AddItem_WhenTargetGroupDoesNotExists_ShouldCreateAndAddNewGroup()
173162 }
174163
175164 [ TestMethod ]
176- public void AddItem_WhenSingleTargetGroupAlreadyExists_ShouldAddItemToExistingGroup ( )
165+ public void Test_ObservableGroupedCollectionExtensions_AddItem_WhenSingleTargetGroupAlreadyExists_ShouldAddItemToExistingGroup ( )
177166 {
178167 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
179168
@@ -202,7 +191,7 @@ public void AddItem_WhenSingleTargetGroupAlreadyExists_ShouldAddItemToExistingGr
202191 }
203192
204193 [ TestMethod ]
205- public void AddItem_WhenSeveralTargetGroupsAlreadyExist_ShouldAddItemToFirstExistingGroup ( )
194+ public void Test_ObservableGroupedCollectionExtensions_AddItem_WhenSeveralTargetGroupsAlreadyExist_ShouldAddItemToFirstExistingGroup ( )
206195 {
207196 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
208197
@@ -235,7 +224,7 @@ public void AddItem_WhenSeveralTargetGroupsAlreadyExist_ShouldAddItemToFirstExis
235224 }
236225
237226 [ TestMethod ]
238- public void RemoveGroup_WhenGroupDoesNotExists_ShouldDoNothing ( )
227+ public void Test_ObservableGroupedCollectionExtensions_RemoveGroup_WhenGroupDoesNotExists_ShouldDoNothing ( )
239228 {
240229 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
241230
@@ -249,7 +238,7 @@ public void RemoveGroup_WhenGroupDoesNotExists_ShouldDoNothing()
249238 }
250239
251240 [ TestMethod ]
252- public void RemoveGroup_WhenSingleGroupExists_ShouldRemoveGroup ( )
241+ public void Test_ObservableGroupedCollectionExtensions_RemoveGroup_WhenSingleGroupExists_ShouldRemoveGroup ( )
253242 {
254243 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
255244
@@ -264,7 +253,7 @@ public void RemoveGroup_WhenSingleGroupExists_ShouldRemoveGroup()
264253 }
265254
266255 [ TestMethod ]
267- public void RemoveGroup_WhenSeveralGroupsExist_ShouldRemoveFirstGroup ( )
256+ public void Test_ObservableGroupedCollectionExtensions_RemoveGroup_WhenSeveralGroupsExist_ShouldRemoveFirstGroup ( )
268257 {
269258 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
270259
@@ -286,7 +275,7 @@ public void RemoveGroup_WhenSeveralGroupsExist_ShouldRemoveFirstGroup()
286275 [ TestMethod ]
287276 [ DataRow ( true ) ]
288277 [ DataRow ( false ) ]
289- public void RemoveItem_WhenGroupDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
278+ public void Test_ObservableGroupedCollectionExtensions_RemoveItem_WhenGroupDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
290279 {
291280 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
292281
@@ -307,7 +296,7 @@ public void RemoveItem_WhenGroupDoesNotExist_ShouldDoNothing(bool removeGroupIfE
307296 [ TestMethod ]
308297 [ DataRow ( true ) ]
309298 [ DataRow ( false ) ]
310- public void RemoveItem_WhenGroupExistsAndItemDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
299+ public void Test_ObservableGroupedCollectionExtensions_RemoveItem_WhenGroupExistsAndItemDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
311300 {
312301 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
313302
@@ -328,7 +317,7 @@ public void RemoveItem_WhenGroupExistsAndItemDoesNotExist_ShouldDoNothing(bool r
328317 [ TestMethod ]
329318 [ DataRow ( true ) ]
330319 [ DataRow ( false ) ]
331- public void RemoveItem_WhenGroupAndItemExist_ShouldRemoveItemFromGroup ( bool removeGroupIfEmpty )
320+ public void Test_ObservableGroupedCollectionExtensions_RemoveItem_WhenGroupAndItemExist_ShouldRemoveItemFromGroup ( bool removeGroupIfEmpty )
332321 {
333322 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
334323
@@ -349,7 +338,7 @@ public void RemoveItem_WhenGroupAndItemExist_ShouldRemoveItemFromGroup(bool remo
349338 [ TestMethod ]
350339 [ DataRow ( true , true ) ]
351340 [ DataRow ( false , false ) ]
352- public void RemoveItem_WhenRemovingLastItem_ShouldRemoveGroupIfRequired ( bool removeGroupIfEmpty , bool expectGroupRemoved )
341+ public void Test_ObservableGroupedCollectionExtensions_RemoveItem_WhenRemovingLastItem_ShouldRemoveGroupIfRequired ( bool removeGroupIfEmpty , bool expectGroupRemoved )
353342 {
354343 ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
355344
0 commit comments