@@ -10,15 +10,15 @@ public class TreeListViewItemsCollectionTests
10
10
[ Fact ]
11
11
public void Constructor_AcceptsNull ( )
12
12
{
13
- TreeListViewItemsCollection < string > collection = new ( null ) ;
13
+ TreeListViewItemsCollection collection = new ( null ) ;
14
14
15
15
Assert . Empty ( collection ) ;
16
16
}
17
17
18
18
[ Fact ]
19
19
public void Constructor_AcceptsObject ( )
20
20
{
21
- TreeListViewItemsCollection < string > collection = new ( new object ( ) ) ;
21
+ TreeListViewItemsCollection collection = new ( new object ( ) ) ;
22
22
23
23
Assert . Empty ( collection ) ;
24
24
}
@@ -27,7 +27,7 @@ public void Constructor_AcceptsObject()
27
27
public void Constructor_AcceptsIEnumerable ( )
28
28
{
29
29
IEnumerable < string > enumerable = new [ ] { "a" , "b" , "c" } ;
30
- TreeListViewItemsCollection < string > collection = new ( enumerable ) ;
30
+ TreeListViewItemsCollection collection = new ( enumerable ) ;
31
31
32
32
Assert . Equal ( new [ ] { "a" , "b" , "c" } , collection ) ;
33
33
}
@@ -38,7 +38,7 @@ public void WhenWrappedObjectImplementsIncc_ItHandlesAdditions()
38
38
//Arrange
39
39
ObservableCollection < string > collection = new ( ) ;
40
40
41
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( collection ) ;
41
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( collection ) ;
42
42
43
43
//Act
44
44
collection . Add ( "a" ) ;
@@ -53,7 +53,7 @@ public void WhenWrappedObjectImplementsIncc_ItHandlesRemovals()
53
53
//Arrange
54
54
ObservableCollection < string > collection = new ( ) { "a" } ;
55
55
56
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( collection ) ;
56
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( collection ) ;
57
57
58
58
//Act
59
59
collection . Remove ( "a" ) ;
@@ -68,7 +68,7 @@ public void WhenWrappedObjectImplementsIncc_ItHandlesReplacements()
68
68
//Arrange
69
69
ObservableCollection < string > collection = new ( ) { "a" , "b" , "c" } ;
70
70
71
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( collection ) ;
71
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( collection ) ;
72
72
73
73
// Simulate expansion
74
74
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
@@ -98,7 +98,7 @@ public void WhenWrappedObjectImplementsIncc_ItHandlesReset()
98
98
//Arrange
99
99
TestableCollection < string > collection = new ( ) { "a" } ;
100
100
101
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( collection ) ;
101
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( collection ) ;
102
102
103
103
//Act
104
104
collection . ReplaceAllItems ( "b" , "c" ) ;
@@ -113,7 +113,7 @@ public void WhenWrappedObjectImplementsIncc_ItHandlesMoves()
113
113
//Arrange
114
114
ObservableCollection < string > collection = new ( ) { "a" , "b" , "c" } ;
115
115
116
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( collection ) ;
116
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( collection ) ;
117
117
118
118
//Act
119
119
collection . Move ( 0 , 2 ) ;
@@ -134,7 +134,7 @@ public void WhenWrappedObjectImplementsIncc_ItHandlesMoves()
134
134
public void WhenAddingItemAtNestedLevel_ItSetsTheItemsLevel ( int insertionIndex , int requestedLevel )
135
135
{
136
136
//Arrange
137
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" } ) ;
137
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" } ) ;
138
138
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
139
139
treeListViewItemsCollection . InsertWithLevel ( 2 , "a_b" , 1 ) ;
140
140
/*
@@ -167,7 +167,7 @@ public void WhenAddingItemAtNestedLevel_ItSetsTheItemsLevel(int insertionIndex,
167
167
public void InsertWithLevel_WhenAddingItemAtNestedLevel_ItThrowsIfRequestIsOutOfRange ( int insertionIndex , int requestedLevel )
168
168
{
169
169
//Arrange
170
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" } ) ;
170
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" } ) ;
171
171
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
172
172
treeListViewItemsCollection . InsertWithLevel ( 2 , "a_b" , 1 ) ;
173
173
/*
@@ -184,7 +184,7 @@ public void InsertWithLevel_WhenAddingItemAtNestedLevel_ItThrowsIfRequestIsOutOf
184
184
[ Fact ]
185
185
public void InsertWithLevel_WhenInsertingFirstSibling_MarksIndexAsExpanded ( )
186
186
{
187
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" } ) ;
187
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" } ) ;
188
188
189
189
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
190
190
/*
@@ -203,7 +203,7 @@ public void InsertWithLevel_WhenInsertingFirstSibling_MarksIndexAsExpanded()
203
203
public void WhenRemovingItem_ItRemovesItemsAndAnyChildren ( int indexToRemove , string [ ] expectedItems , int [ ] expectedLevels )
204
204
{
205
205
//Arrange
206
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
206
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
207
207
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
208
208
treeListViewItemsCollection . InsertWithLevel ( 2 , "a_a_a" , 2 ) ;
209
209
treeListViewItemsCollection . InsertWithLevel ( 3 , "a_a_b" , 2 ) ;
@@ -231,7 +231,7 @@ public void WhenRemovingItem_ItRemovesItemsAndAnyChildren(int indexToRemove, str
231
231
public void Move_WhenMovingItemUp_ItMovesChildrenAlongWithIt ( )
232
232
{
233
233
//Arrange
234
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
234
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
235
235
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
236
236
treeListViewItemsCollection . InsertWithLevel ( 2 , "a_b" , 1 ) ;
237
237
treeListViewItemsCollection . InsertWithLevel ( 4 , "b_a" , 1 ) ;
@@ -267,7 +267,7 @@ public void Move_WhenMovingItemUp_ItMovesChildrenAlongWithIt()
267
267
public void Move_WhenMovingItemUpMultipleLevels_ItMovesChildrenAlongWithIt ( )
268
268
{
269
269
//Arrange
270
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
270
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
271
271
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
272
272
treeListViewItemsCollection . InsertWithLevel ( 2 , "a_b" , 1 ) ;
273
273
treeListViewItemsCollection . InsertWithLevel ( 4 , "b_a" , 1 ) ;
@@ -301,7 +301,7 @@ public void Move_WhenMovingItemUpMultipleLevels_ItMovesChildrenAlongWithIt()
301
301
public void Move_WhenMovingItemDown_ItMovesChildrenAlongWithIt ( )
302
302
{
303
303
//Arrange
304
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
304
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
305
305
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
306
306
treeListViewItemsCollection . InsertWithLevel ( 2 , "a_b" , 1 ) ;
307
307
treeListViewItemsCollection . InsertWithLevel ( 4 , "b_a" , 1 ) ;
@@ -337,7 +337,7 @@ public void Move_WhenMovingItemDown_ItMovesChildrenAlongWithIt()
337
337
public void Move_WhenMovingItemDownMultipleLevels_ItMovesChildrenAlongWithIt ( )
338
338
{
339
339
//Arrange
340
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
340
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( new [ ] { "a" , "b" , "c" } ) ;
341
341
treeListViewItemsCollection . InsertWithLevel ( 1 , "a_a" , 1 ) ;
342
342
treeListViewItemsCollection . InsertWithLevel ( 2 , "a_b" , 1 ) ;
343
343
treeListViewItemsCollection . InsertWithLevel ( 4 , "b_a" , 1 ) ;
@@ -372,7 +372,7 @@ public void Move_WithWrappedCollection_ItMovesChildrenAlongWithIt()
372
372
{
373
373
//Arrange
374
374
ObservableCollection < string > boundCollection = new ( ) { "a" , "b" , "c" } ;
375
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( boundCollection ) ;
375
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( boundCollection ) ;
376
376
treeListViewItemsCollection . InsertWithLevel ( 2 , "b_a" , 1 ) ;
377
377
treeListViewItemsCollection . InsertWithLevel ( 3 , "b_b" , 1 ) ;
378
378
treeListViewItemsCollection . InsertWithLevel ( 4 , "b_c" , 1 ) ;
@@ -401,7 +401,7 @@ public void Move_WithExpandedChild_ItMovesChildrenUp()
401
401
{
402
402
//Arrange
403
403
ObservableCollection < string > boundCollection = new ( ) { "0" , "1" , "2" } ;
404
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( boundCollection ) ;
404
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( boundCollection ) ;
405
405
treeListViewItemsCollection . InsertWithLevel ( 2 , "1_0" , 1 ) ;
406
406
treeListViewItemsCollection . InsertWithLevel ( 3 , "1_1" , 1 ) ;
407
407
treeListViewItemsCollection . InsertWithLevel ( 4 , "1_1_0" , 2 ) ;
@@ -459,7 +459,7 @@ public void Move_WithExpandedChild_ItMovesChildrenDown()
459
459
{
460
460
//Arrange
461
461
ObservableCollection < string > boundCollection = new ( ) { "0" , "1" , "2" } ;
462
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( boundCollection ) ;
462
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( boundCollection ) ;
463
463
treeListViewItemsCollection . InsertWithLevel ( 1 , "0_0" , 1 ) ;
464
464
treeListViewItemsCollection . InsertWithLevel ( 2 , "0_1" , 1 ) ;
465
465
treeListViewItemsCollection . InsertWithLevel ( 3 , "0_1_0" , 2 ) ;
@@ -517,7 +517,7 @@ public void Replace_WithExpandedChild_ItRemovesChildren()
517
517
{
518
518
//Arrange
519
519
ObservableCollection < string > boundCollection = new ( ) { "0" , "1" , "2" } ;
520
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( boundCollection ) ;
520
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( boundCollection ) ;
521
521
treeListViewItemsCollection . InsertWithLevel ( 3 , "2_0" , 1 ) ;
522
522
treeListViewItemsCollection . InsertWithLevel ( 4 , "2_1" , 1 ) ;
523
523
treeListViewItemsCollection . InsertWithLevel ( 5 , "2_2" , 1 ) ;
@@ -560,7 +560,7 @@ public void Replace_TopLevelItem_IsReplaced(int indexToReplace)
560
560
{
561
561
//Arrange
562
562
ObservableCollection < string > boundCollection = new ( ) { "0" , "1" , "2" } ;
563
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( boundCollection ) ;
563
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( boundCollection ) ;
564
564
565
565
/*
566
566
* 0. 0
@@ -598,7 +598,7 @@ public void GetParent_WithInvalidIndex_ThrowsOutOfRangeException(int index)
598
598
{
599
599
//Arrange
600
600
ObservableCollection < string > boundCollection = new ( ) { "0" , "1" , "2" } ;
601
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( boundCollection ) ;
601
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( boundCollection ) ;
602
602
603
603
//Act/Assert
604
604
var ex = Assert . Throws < ArgumentOutOfRangeException > ( ( ) => treeListViewItemsCollection . GetParent ( index ) ) ;
@@ -610,7 +610,7 @@ public void GetParent_WithNestedItem_ReturnsParent()
610
610
{
611
611
//Arrange
612
612
ObservableCollection < string > boundCollection = new ( ) { "0" , "1" , "2" } ;
613
- TreeListViewItemsCollection < string > treeListViewItemsCollection = new ( boundCollection ) ;
613
+ TreeListViewItemsCollection treeListViewItemsCollection = new ( boundCollection ) ;
614
614
treeListViewItemsCollection . InsertWithLevel ( 2 , "1_0" , 1 ) ;
615
615
treeListViewItemsCollection . InsertWithLevel ( 3 , "1_1" , 1 ) ;
616
616
treeListViewItemsCollection . InsertWithLevel ( 4 , "1_2" , 1 ) ;
@@ -674,15 +674,15 @@ public void ReplaceAllItems(params T[] newItems)
674
674
675
675
public static class TreeListViewItemsCollectionExtensions
676
676
{
677
- public static IEnumerable < int > GetAllLevels < T > ( this TreeListViewItemsCollection < T > collection )
677
+ public static IEnumerable < int > GetAllLevels ( this TreeListViewItemsCollection collection )
678
678
{
679
679
for ( int i = 0 ; i < collection . Count ; i ++ )
680
680
{
681
681
yield return collection . GetLevel ( i ) ;
682
682
}
683
683
}
684
684
685
- public static IEnumerable < bool > GetAllIsExpanded < T > ( this TreeListViewItemsCollection < T > collection )
685
+ public static IEnumerable < bool > GetAllIsExpanded ( this TreeListViewItemsCollection collection )
686
686
{
687
687
for ( int i = 0 ; i < collection . Count ; i ++ )
688
688
{
0 commit comments