File tree 1 file changed +10
-1
lines changed 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -105,11 +105,20 @@ let result = try fetchResource(location)
105
105
.toBlocking ()
106
106
.materialize ()
107
107
108
+ // For testing the results or error in the case of terminating with error
108
109
switch result {
109
110
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." )
111
112
case .failed (let elements, let error):
112
113
XCTAssertEqual (elements, expectedResult)
113
114
XCTAssertErrorEqual (error, expectedError)
114
115
}
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
+ }
115
124
```
You can’t perform that action at this time.
0 commit comments