You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XCTAssert(![self.tableView isSectionOpen:0] && [self.tableView isSectionOpen:1], @"Section 0 should be closed when Section 1 was being forced to be open.");
XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.sectionInfos[section] numberOfRows], @"The number of rows in section %d of our data source should match those of the FZAccordionTableView.", (int)section);
129
133
}
130
134
131
-
//- (void)testDeletingRowWithClosedSection {
132
-
//
133
-
// NSInteger section = 0;
134
-
//
135
-
// XCTAssert(![self.tableView isSectionOpen:section], @"Section %d should be closed.", (int)section);
136
-
//
137
-
// XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.numOfRowsForSection[@(section)] integerValue], @"The number of rows in section %d of our data source should match those of the FZAccordionTableView 'numOfRowsForSection'", (int)section);
// XCTAssert([self.mainViewController.sections[section] integerValue] != [self.tableView.numOfRowsForSection[@(section)] integerValue], @"Without calling 'deleteForRows' there should be a difference between data source and what the tableView says.");
143
-
//
144
-
// // Calling 'deleteRowsAtIndexPaths' propogates the necessary methods/changes, but throws an exception that we can just ignore.
// XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.numOfRowsForSection[@(section)] integerValue], @"The number of rows in section %d of our data source should match those of the FZAccordionTableView 'numOfRowsForSection' after deletion.", (int)section);
151
-
//}
135
+
- (void)testDeletingRowWithClosedSection {
136
+
137
+
NSInteger section = 0;
138
+
139
+
[selfwaitForHeaderViewInSection:section];
140
+
XCTAssert(![self.tableView isSectionOpen:section], @"Section %d should be closed.", (int)section);
141
+
142
+
// Make sure initial conditions hold
143
+
XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.sectionInfos[section] numberOfRows], @"The number of rows in section %d of our data source should match those of the FZAccordionTableView 'numOfRowsForSection'", (int)section);
XCTAssert([self.mainViewController.sections[section] integerValue] != [self.tableView.sectionInfos[section] numberOfRows], @"Without calling 'deleteForRows' there should be a difference between data source and what the tableView says.");
// Calling 'deleteRowsAtIndexPaths' propogates the necessary methods/changes, but throws an exception that we can just ignore.
157
+
}
158
+
159
+
XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.sectionInfos[section] numberOfRows], @"The number of rows in section %d of our data source should match those of the FZAccordionTableView.", (int)section);
XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.sectionInfos[section] numberOfRows], @"The data source section rows should match up.");
182
+
XCTAssert(initialSectionCount+1 == self.tableView.numberOfSections, @"The section counts should match up.");
183
+
}
184
+
185
+
#pragma mark - Delete Section -
186
+
187
+
- (void)testDeleteClosedSection {
188
+
189
+
NSInteger section = 0;
190
+
191
+
// Open the section
192
+
[selfwaitForHeaderViewInSection:section];
193
+
XCTAssert(![self.tableView isSectionOpen:section], @"Section %d should be closed.", (int)section);
XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.sectionInfos[section] numberOfRows], @"The data source section rows should match up.");
203
+
XCTAssert(self.mainViewController.sections.count == self.tableView.numberOfSections, @"The section counts should match up.");
204
+
}
205
+
206
+
- (void)testDeleteOpenSection {
207
+
208
+
NSInteger section = 0;
209
+
210
+
// Open the section
211
+
[selfwaitForHeaderViewInSection:section];
212
+
[self.tableView toggleSection:section];
213
+
XCTAssert([self.tableView isSectionOpen:section], @"Section %d should be open.", (int)section);
XCTAssert([self.mainViewController.sections[section] integerValue] == [self.tableView.sectionInfos[section] numberOfRows], @"The data source section rows should match up.");
223
+
XCTAssert(self.mainViewController.sections.count == self.tableView.numberOfSections, @"The section counts should match up.");
0 commit comments