Skip to content

Commit 1b9962b

Browse files
sgleadowkzaher
authored andcommitted
Fixed typo in documentation, and added example for successful case
1 parent cdc8f59 commit 1b9962b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Documentation/UnitTests.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,20 @@ let result = try fetchResource(location)
105105
.toBlocking()
106106
.materialize()
107107

108+
// For testing the results or error in the case of terminating with error
108109
switch result {
109110
case .completed:
110-
XCTFail("Expected result to be complete eith error, but result was successful.")
111+
XCTFail("Expected result to complete with error, but result was successful.")
111112
case .failed(let elements, let error):
112113
XCTAssertEqual(elements, expectedResult)
113114
XCTAssertErrorEqual(error, expectedError)
114115
}
116+
117+
// For testing the results in the case of termination with completion
118+
switch result {
119+
case .completed(let elements):
120+
XCTAssertEqual(elements, expectedResult)
121+
case .failed(_, let error):
122+
XCTFail("Expected result to complete without error, but received \(error).")
123+
}
115124
```

0 commit comments

Comments
 (0)