@@ -22,7 +22,7 @@ extension XCTestCase {
22
22
id: String = . random,
23
23
sectionId: ( Int ) -> String = defaultSectionId,
24
24
cellId: ( Int , Int ) -> String = defaultCellId,
25
- supplementaryViewId: ( Int , Int ) -> String = defaultCellId ,
25
+ supplementaryViewId: ( Int , Int ) -> String = defaultViewId ,
26
26
numSections: Int = Int . random ( in: 2 ... 15 ) ,
27
27
numCells: Int ? = nil ,
28
28
useCellNibs: Bool = false ,
@@ -47,14 +47,14 @@ extension XCTestCase {
47
47
function: function
48
48
)
49
49
}
50
- return CollectionViewModel ( id: " collection_ \( id ) " , sections: sections)
50
+ return CollectionViewModel ( id: id , sections: sections)
51
51
}
52
52
53
53
@MainActor
54
54
func fakeSectionViewModel(
55
55
id: String = . random,
56
56
cellId: ( Int , Int ) -> String = defaultCellId,
57
- supplementaryViewId: ( Int , Int ) -> String = defaultCellId ,
57
+ supplementaryViewId: ( Int , Int ) -> String = defaultViewId ,
58
58
sectionIndex: Int = 0 ,
59
59
numCells: Int = Int . random ( in: 1 ... 20 ) ,
60
60
useCellNibs: Bool = false ,
@@ -98,7 +98,7 @@ extension XCTestCase {
98
98
} : [ ]
99
99
100
100
return SectionViewModel (
101
- id: " section_ \( id ) " ,
101
+ id: id ,
102
102
cells: cells,
103
103
header: header,
104
104
footer: footer,
@@ -184,9 +184,13 @@ extension XCTestCase {
184
184
}
185
185
186
186
private func defaultSectionId( _ index: Int ) -> String {
187
- " \( index) "
187
+ " section_ \( index) "
188
188
}
189
189
190
190
private func defaultCellId( _ sectionIndex: Int , _ itemIndex: Int ) -> String {
191
- " \( sectionIndex) - \( itemIndex) "
191
+ " cell_ \( sectionIndex) _ \( itemIndex) "
192
+ }
193
+
194
+ private func defaultViewId( _ sectionIndex: Int , _ itemIndex: Int ) -> String {
195
+ " view_ \( sectionIndex) _ \( itemIndex) "
192
196
}
0 commit comments