@@ -12,7 +12,7 @@ namespace CommunityToolkit.Mvvm.UnitTests.Collections;
12
12
public class Test_ObservableGroupedCollectionExtensions
13
13
{
14
14
[ TestMethod ]
15
- public void First_WhenGroupExists_ShouldReturnFirstGroup ( )
15
+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupExists_ShouldReturnFirstGroup ( )
16
16
{
17
17
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
18
18
@@ -29,7 +29,7 @@ public void First_WhenGroupExists_ShouldReturnFirstGroup()
29
29
30
30
[ TestMethod ]
31
31
[ ExpectedException ( typeof ( InvalidOperationException ) ) ]
32
- public void First_WhenGroupDoesNotExist_ShouldThrow ( )
32
+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupDoesNotExist_ShouldThrow ( )
33
33
{
34
34
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
35
35
@@ -39,7 +39,7 @@ public void First_WhenGroupDoesNotExist_ShouldThrow()
39
39
}
40
40
41
41
[ TestMethod ]
42
- public void FirstOrDefault_WhenGroupExists_ShouldReturnFirstGroup ( )
42
+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKeyOrDefault_WhenGroupExists_ShouldReturnFirstGroup ( )
43
43
{
44
44
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
45
45
@@ -55,7 +55,7 @@ public void FirstOrDefault_WhenGroupExists_ShouldReturnFirstGroup()
55
55
}
56
56
57
57
[ TestMethod ]
58
- public void FirstOrDefault_WhenGroupDoesNotExist_ShouldReturnNull ( )
58
+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKeyOrDefault_WhenGroupDoesNotExist_ShouldReturnNull ( )
59
59
{
60
60
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
61
61
@@ -67,7 +67,7 @@ public void FirstOrDefault_WhenGroupDoesNotExist_ShouldReturnNull()
67
67
}
68
68
69
69
[ TestMethod ]
70
- public void ElementAt_WhenGroupExistsAndIndexInRange_ShouldReturnFirstGroupValue ( )
70
+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupExistsAndIndexInRange_ShouldReturnFirstGroupValue ( )
71
71
{
72
72
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
73
73
@@ -84,7 +84,7 @@ public void ElementAt_WhenGroupExistsAndIndexInRange_ShouldReturnFirstGroupValue
84
84
[ DataRow ( - 1 ) ]
85
85
[ DataRow ( 3 ) ]
86
86
[ ExpectedException ( typeof ( ArgumentOutOfRangeException ) ) ]
87
- public void ElementAt_WhenGroupExistsAndIndexOutOfRange_ShouldReturnThrow ( int index )
87
+ public void Test_ObservableGroupedCollectionExtensions_FirstGroupByKey_WhenGroupExistsAndIndexOutOfRange_ShouldReturnThrow ( int index )
88
88
{
89
89
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
90
90
@@ -96,18 +96,7 @@ public void ElementAt_WhenGroupExistsAndIndexOutOfRange_ShouldReturnThrow(int in
96
96
}
97
97
98
98
[ 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 ( )
111
100
{
112
101
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
113
102
@@ -121,7 +110,7 @@ public void ElementAtOrDefault_WhenGroupExistsAndIndexInRange_ShouldReturnValue(
121
110
}
122
111
123
112
[ TestMethod ]
124
- public void AddGroup_WithItem_ShouldAddGroup ( )
113
+ public void Test_ObservableGroupedCollectionExtensions_AddGroup_WithItem_ShouldAddGroup ( )
125
114
{
126
115
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
127
116
@@ -134,7 +123,7 @@ public void AddGroup_WithItem_ShouldAddGroup()
134
123
}
135
124
136
125
[ TestMethod ]
137
- public void AddGroup_WithCollection_ShouldAddGroup ( )
126
+ public void Test_ObservableGroupedCollectionExtensions_AddGroup_WithCollection_ShouldAddGroup ( )
138
127
{
139
128
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
140
129
@@ -147,7 +136,7 @@ public void AddGroup_WithCollection_ShouldAddGroup()
147
136
}
148
137
149
138
[ TestMethod ]
150
- public void AddGroup_WithParamsCollection_ShouldAddGroup ( )
139
+ public void Test_ObservableGroupedCollectionExtensions_AddGroup_WithParamsCollection_ShouldAddGroup ( )
151
140
{
152
141
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
153
142
@@ -160,7 +149,7 @@ public void AddGroup_WithParamsCollection_ShouldAddGroup()
160
149
}
161
150
162
151
[ TestMethod ]
163
- public void AddItem_WhenTargetGroupDoesNotExists_ShouldCreateAndAddNewGroup ( )
152
+ public void Test_ObservableGroupedCollectionExtensions_AddItem_WhenTargetGroupDoesNotExists_ShouldCreateAndAddNewGroup ( )
164
153
{
165
154
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
166
155
@@ -173,7 +162,7 @@ public void AddItem_WhenTargetGroupDoesNotExists_ShouldCreateAndAddNewGroup()
173
162
}
174
163
175
164
[ TestMethod ]
176
- public void AddItem_WhenSingleTargetGroupAlreadyExists_ShouldAddItemToExistingGroup ( )
165
+ public void Test_ObservableGroupedCollectionExtensions_AddItem_WhenSingleTargetGroupAlreadyExists_ShouldAddItemToExistingGroup ( )
177
166
{
178
167
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
179
168
@@ -202,7 +191,7 @@ public void AddItem_WhenSingleTargetGroupAlreadyExists_ShouldAddItemToExistingGr
202
191
}
203
192
204
193
[ TestMethod ]
205
- public void AddItem_WhenSeveralTargetGroupsAlreadyExist_ShouldAddItemToFirstExistingGroup ( )
194
+ public void Test_ObservableGroupedCollectionExtensions_AddItem_WhenSeveralTargetGroupsAlreadyExist_ShouldAddItemToFirstExistingGroup ( )
206
195
{
207
196
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
208
197
@@ -235,7 +224,7 @@ public void AddItem_WhenSeveralTargetGroupsAlreadyExist_ShouldAddItemToFirstExis
235
224
}
236
225
237
226
[ TestMethod ]
238
- public void RemoveGroup_WhenGroupDoesNotExists_ShouldDoNothing ( )
227
+ public void Test_ObservableGroupedCollectionExtensions_RemoveGroup_WhenGroupDoesNotExists_ShouldDoNothing ( )
239
228
{
240
229
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
241
230
@@ -249,7 +238,7 @@ public void RemoveGroup_WhenGroupDoesNotExists_ShouldDoNothing()
249
238
}
250
239
251
240
[ TestMethod ]
252
- public void RemoveGroup_WhenSingleGroupExists_ShouldRemoveGroup ( )
241
+ public void Test_ObservableGroupedCollectionExtensions_RemoveGroup_WhenSingleGroupExists_ShouldRemoveGroup ( )
253
242
{
254
243
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
255
244
@@ -264,7 +253,7 @@ public void RemoveGroup_WhenSingleGroupExists_ShouldRemoveGroup()
264
253
}
265
254
266
255
[ TestMethod ]
267
- public void RemoveGroup_WhenSeveralGroupsExist_ShouldRemoveFirstGroup ( )
256
+ public void Test_ObservableGroupedCollectionExtensions_RemoveGroup_WhenSeveralGroupsExist_ShouldRemoveFirstGroup ( )
268
257
{
269
258
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
270
259
@@ -286,7 +275,7 @@ public void RemoveGroup_WhenSeveralGroupsExist_ShouldRemoveFirstGroup()
286
275
[ TestMethod ]
287
276
[ DataRow ( true ) ]
288
277
[ DataRow ( false ) ]
289
- public void RemoveItem_WhenGroupDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
278
+ public void Test_ObservableGroupedCollectionExtensions_RemoveItem_WhenGroupDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
290
279
{
291
280
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
292
281
@@ -307,7 +296,7 @@ public void RemoveItem_WhenGroupDoesNotExist_ShouldDoNothing(bool removeGroupIfE
307
296
[ TestMethod ]
308
297
[ DataRow ( true ) ]
309
298
[ DataRow ( false ) ]
310
- public void RemoveItem_WhenGroupExistsAndItemDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
299
+ public void Test_ObservableGroupedCollectionExtensions_RemoveItem_WhenGroupExistsAndItemDoesNotExist_ShouldDoNothing ( bool removeGroupIfEmpty )
311
300
{
312
301
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
313
302
@@ -328,7 +317,7 @@ public void RemoveItem_WhenGroupExistsAndItemDoesNotExist_ShouldDoNothing(bool r
328
317
[ TestMethod ]
329
318
[ DataRow ( true ) ]
330
319
[ DataRow ( false ) ]
331
- public void RemoveItem_WhenGroupAndItemExist_ShouldRemoveItemFromGroup ( bool removeGroupIfEmpty )
320
+ public void Test_ObservableGroupedCollectionExtensions_RemoveItem_WhenGroupAndItemExist_ShouldRemoveItemFromGroup ( bool removeGroupIfEmpty )
332
321
{
333
322
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
334
323
@@ -349,7 +338,7 @@ public void RemoveItem_WhenGroupAndItemExist_ShouldRemoveItemFromGroup(bool remo
349
338
[ TestMethod ]
350
339
[ DataRow ( true , true ) ]
351
340
[ 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 )
353
342
{
354
343
ObservableGroupedCollection < string , int > groupedCollection = new ( ) ;
355
344
0 commit comments