@@ -46,7 +46,7 @@ internal final class OptionRowTests: XCTestCase {
4646 XCTAssertEqual ( row. isSelected, true )
4747
4848 // With RowStyle
49- XCTAssertEqual ( row. cellReuseIdentifier, " UITableViewCell " )
49+ XCTAssertEqual ( row. cellReuseIdentifier, " UITableViewCell.subtitle " )
5050 XCTAssertEqual ( row. cellStyle, . subtitle)
5151 XCTAssertEqual ( row. icon, icon)
5252 XCTAssertEqual ( row. accessoryType, . checkmark)
@@ -60,6 +60,50 @@ internal final class OptionRowTests: XCTestCase {
6060 XCTAssertEqual ( actionInvoked, true )
6161 }
6262
63+ func testCellStyleWithReuseIdentifier( ) {
64+ // When
65+ let a = OptionRow ( text: " " , detailText: nil , isSelected: true , action: { _ in } )
66+ let b = OptionRow ( text: " " , detailText: DetailText . none, isSelected: true , action: { _ in } )
67+ let c = OptionRow ( text: " " , detailText: . subtitle( " " ) , isSelected: true , action: { _ in } )
68+ let d = OptionRow ( text: " " , detailText: . value1( " " ) , isSelected: true , action: { _ in } )
69+ let e = OptionRow ( text: " " , detailText: . value2( " " ) , isSelected: true , action: { _ in } )
70+
71+ // Then
72+ XCTAssertEqual ( a. cellStyle, . default)
73+ XCTAssertEqual ( b. cellStyle, . default)
74+ XCTAssertEqual ( c. cellStyle, . subtitle)
75+ XCTAssertEqual ( d. cellStyle, . value1)
76+ XCTAssertEqual ( e. cellStyle, . value2)
77+
78+ XCTAssertEqual ( a. cellReuseIdentifier, " UITableViewCell " )
79+ XCTAssertEqual ( b. cellReuseIdentifier, " UITableViewCell.default " )
80+ XCTAssertEqual ( c. cellReuseIdentifier, " UITableViewCell.subtitle " )
81+ XCTAssertEqual ( d. cellReuseIdentifier, " UITableViewCell.value1 " )
82+ XCTAssertEqual ( e. cellReuseIdentifier, " UITableViewCell.value2 " )
83+ }
84+
85+ func testCellStyleWithReuseIdentifier_customCellType( ) {
86+ // When
87+ let a = OptionRow < CustomOptionCell > ( text: " " , detailText: nil , isSelected: true , action: { _ in } )
88+ let b = OptionRow < CustomOptionCell > ( text: " " , detailText: DetailText . none, isSelected: true , action: { _ in } )
89+ let c = OptionRow < CustomOptionCell > ( text: " " , detailText: . subtitle( " " ) , isSelected: true , action: { _ in } )
90+ let d = OptionRow < CustomOptionCell > ( text: " " , detailText: . value1( " " ) , isSelected: true , action: { _ in } )
91+ let e = OptionRow < CustomOptionCell > ( text: " " , detailText: . value2( " " ) , isSelected: true , action: { _ in } )
92+
93+ // Then
94+ XCTAssertEqual ( a. cellStyle, . default)
95+ XCTAssertEqual ( b. cellStyle, . default)
96+ XCTAssertEqual ( c. cellStyle, . subtitle)
97+ XCTAssertEqual ( d. cellStyle, . value1)
98+ XCTAssertEqual ( e. cellStyle, . value2)
99+
100+ XCTAssertEqual ( a. cellReuseIdentifier, " CustomOptionCell " )
101+ XCTAssertEqual ( b. cellReuseIdentifier, " CustomOptionCell.default " )
102+ XCTAssertEqual ( c. cellReuseIdentifier, " CustomOptionCell.subtitle " )
103+ XCTAssertEqual ( d. cellReuseIdentifier, " CustomOptionCell.value1 " )
104+ XCTAssertEqual ( e. cellReuseIdentifier, " CustomOptionCell.value2 " )
105+ }
106+
63107 // MARK: - Equatable
64108
65109 func testEquatable_withIdenticalParameters( ) {
0 commit comments