Skip to content

Commit 1dd478e

Browse files
committed
ResultsControllerTests: Documenting Unit Tests
1 parent 5a55367 commit 1dd478e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Yosemite/YosemiteTests/Tools/ResultsControllerTests.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ResultsControllerTests: XCTestCase {
3434
}
3535

3636

37-
///
37+
/// Verifies that the Results Controller has an Empty Section right after the Fetch OP is performed.
3838
///
3939
func testResultsControllerStartsEmptySectionAfterPerformingFetch() {
4040
let resultsController = ResultsController<Storage.Account>(viewContext: viewContext, sortedBy: [sampleSortDescriptor])
@@ -46,7 +46,7 @@ class ResultsControllerTests: XCTestCase {
4646
}
4747

4848

49-
///
49+
/// Verifies that ResultsController does pick up pre-existant entities, right after performFetch runs.
5050
///
5151
func testResultsControllerPicksUpEntitiesAvailablePriorToInstantiation() {
5252
insertSampleAccount(into: viewContext)
@@ -60,7 +60,7 @@ class ResultsControllerTests: XCTestCase {
6060
}
6161

6262

63-
///
63+
/// Verifies that ResultsController does pick up entities inserted after being instantiated.
6464
///
6565
func testResultsControllerPicksUpEntitiesInsertedAfterInstantiation() {
6666
let resultsController = ResultsController<Storage.Account>(viewContext: viewContext, sortedBy: [sampleSortDescriptor])
@@ -74,7 +74,7 @@ class ResultsControllerTests: XCTestCase {
7474
}
7575

7676

77-
///
77+
/// Verifies that `sectionNameKeyPath` effectively causes the ResultsController to produce multiple sections, based on the grouping parameter.
7878
///
7979
func testResultsControllerGroupSectionsBySectionNameKeypath() {
8080
let sectionNameKeyPath = "userID"
@@ -96,7 +96,7 @@ class ResultsControllerTests: XCTestCase {
9696
}
9797

9898

99-
///
99+
/// Verifies that `object(at indexPath:)` effectively returns the expected (ReadOnly) Entity.
100100
///
101101
func testObjectAtIndexPathReturnsExpectedEntity() {
102102
let sectionNameKeyPath = "userID"
@@ -114,7 +114,7 @@ class ResultsControllerTests: XCTestCase {
114114
}
115115

116116

117-
///
117+
/// Verifies that `onWillChangeContent` is called *before* anything is updated.
118118
///
119119
func testOnWillChangeContentIsEffectivelyCalledBeforeChanges() {
120120
let resultsController = ResultsController<Storage.Account>(viewContext: viewContext, sortedBy: [sampleSortDescriptor])
@@ -137,7 +137,7 @@ class ResultsControllerTests: XCTestCase {
137137
waitForExpectations(timeout: Constants.expectationTimeout, handler: nil)
138138
}
139139

140-
///
140+
/// Verifies that onDidChangeContent is effectivelyc alled *after* the results are altered.
141141
///
142142
func testOnDidChangeContentIsEffectivelyCalledAfterChangesArePerformed() {
143143
let resultsController = ResultsController<Storage.Account>(viewContext: viewContext, sortedBy: [sampleSortDescriptor])
@@ -161,9 +161,9 @@ class ResultsControllerTests: XCTestCase {
161161
}
162162

163163

164+
/// Verifies that `onDidChangeObject` is called whenever a new object is inserted.
164165
///
165-
///
166-
func testOnDidChangeObjectIsEffectivelyCalledOnceChangesArePerformed() {
166+
func testOnDidChangeObjectIsEffectivelyCalledOnceNewObjectsAreInserted() {
167167
let resultsController = ResultsController<Storage.Account>(viewContext: viewContext, sortedBy: [sampleSortDescriptor])
168168
try? resultsController.performFetch()
169169

@@ -183,7 +183,7 @@ class ResultsControllerTests: XCTestCase {
183183
}
184184

185185

186-
///
186+
/// Verifies that `onDidChangeSection` is called whenever new sections are added.
187187
///
188188
func testOnDidChangeSectionIsCalledWheneverNewSectionsAreAdded() {
189189
let sectionNameKeyPath = "userID"

0 commit comments

Comments
 (0)