15
15
*/
16
16
package com.squareup.workflow.rx2
17
17
18
- import com.squareup.workflow.testing.launchForTestingWith
18
+ import com.squareup.workflow.testing.test
19
19
import io.reactivex.BackpressureStrategy.MISSING
20
20
import io.reactivex.Flowable
21
21
import io.reactivex.Maybe
@@ -40,7 +40,7 @@ class RxWorkersTest {
40
40
// Should support out-projected parameters.
41
41
val worker = (subject as Observable <out String ?>).asWorker()
42
42
43
- worker.launchForTestingWith {
43
+ worker.test {
44
44
subject.onNext(" foo" )
45
45
assertEquals(" foo" , nextOutput())
46
46
@@ -53,7 +53,7 @@ class RxWorkersTest {
53
53
val subject = PublishSubject .create<String >()
54
54
val worker = subject.asWorker()
55
55
56
- worker.launchForTestingWith {
56
+ worker.test {
57
57
subject.onComplete()
58
58
assertFinished()
59
59
}
@@ -63,7 +63,7 @@ class RxWorkersTest {
63
63
val subject = PublishSubject .create<String >()
64
64
val worker = subject.asWorker()
65
65
66
- worker.launchForTestingWith {
66
+ worker.test {
67
67
subject.onNext(" foo" )
68
68
assertEquals(" foo" , nextOutput())
69
69
@@ -76,7 +76,7 @@ class RxWorkersTest {
76
76
val subject = PublishSubject .create<String >()
77
77
val worker = subject.asWorker()
78
78
79
- worker.launchForTestingWith {
79
+ worker.test {
80
80
subject.onError(ExpectedException ())
81
81
assertTrue(getException() is ExpectedException )
82
82
}
@@ -90,7 +90,7 @@ class RxWorkersTest {
90
90
91
91
assertEquals(0 , subscriptions)
92
92
93
- worker.launchForTestingWith {
93
+ worker.test {
94
94
assertEquals(1 , subscriptions)
95
95
}
96
96
}
@@ -103,7 +103,7 @@ class RxWorkersTest {
103
103
104
104
assertEquals(0 , disposals)
105
105
106
- worker.launchForTestingWith {
106
+ worker.test {
107
107
assertEquals(0 , disposals)
108
108
cancelWorker()
109
109
assertEquals(1 , disposals)
@@ -119,7 +119,7 @@ class RxWorkersTest {
119
119
val worker = (subject.toFlowable(MISSING ) as Flowable <out String ?>)
120
120
.asWorker()
121
121
122
- worker.launchForTestingWith {
122
+ worker.test {
123
123
subject.onNext(" foo" )
124
124
assertEquals(" foo" , nextOutput())
125
125
@@ -133,7 +133,7 @@ class RxWorkersTest {
133
133
val worker = subject.toFlowable(MISSING )
134
134
.asWorker()
135
135
136
- worker.launchForTestingWith {
136
+ worker.test {
137
137
subject.onComplete()
138
138
assertFinished()
139
139
}
@@ -144,7 +144,7 @@ class RxWorkersTest {
144
144
val worker = subject.toFlowable(MISSING )
145
145
.asWorker()
146
146
147
- worker.launchForTestingWith {
147
+ worker.test {
148
148
subject.onNext(" foo" )
149
149
assertEquals(" foo" , nextOutput())
150
150
@@ -158,7 +158,7 @@ class RxWorkersTest {
158
158
val worker = subject.toFlowable(MISSING )
159
159
.asWorker()
160
160
161
- worker.launchForTestingWith {
161
+ worker.test {
162
162
subject.onError(ExpectedException ())
163
163
assertTrue(getException() is ExpectedException )
164
164
}
@@ -173,7 +173,7 @@ class RxWorkersTest {
173
173
174
174
assertEquals(0 , subscriptions)
175
175
176
- worker.launchForTestingWith {
176
+ worker.test {
177
177
assertEquals(1 , subscriptions)
178
178
}
179
179
}
@@ -187,7 +187,7 @@ class RxWorkersTest {
187
187
188
188
assertEquals(0 , cancels)
189
189
190
- worker.launchForTestingWith {
190
+ worker.test {
191
191
assertEquals(0 , cancels)
192
192
cancelWorker()
193
193
assertEquals(1 , cancels)
@@ -202,7 +202,7 @@ class RxWorkersTest {
202
202
val subject = MaybeSubject .create<String >()
203
203
val worker = (subject as Maybe <out String ?>).asWorker()
204
204
205
- worker.launchForTestingWith {
205
+ worker.test {
206
206
subject.onSuccess(" foo" )
207
207
assertEquals(" foo" , nextOutput())
208
208
assertFinished()
@@ -213,7 +213,7 @@ class RxWorkersTest {
213
213
val subject = MaybeSubject .create<String >()
214
214
val worker = subject.asWorker()
215
215
216
- worker.launchForTestingWith {
216
+ worker.test {
217
217
subject.onComplete()
218
218
assertFinished()
219
219
}
@@ -223,7 +223,7 @@ class RxWorkersTest {
223
223
val subject = MaybeSubject .create<String >()
224
224
val worker = subject.asWorker()
225
225
226
- worker.launchForTestingWith {
226
+ worker.test {
227
227
subject.onError(ExpectedException ())
228
228
assertTrue(getException() is ExpectedException )
229
229
}
@@ -237,7 +237,7 @@ class RxWorkersTest {
237
237
238
238
assertEquals(0 , subscriptions)
239
239
240
- worker.launchForTestingWith {
240
+ worker.test {
241
241
assertEquals(1 , subscriptions)
242
242
}
243
243
}
@@ -250,7 +250,7 @@ class RxWorkersTest {
250
250
251
251
assertEquals(0 , cancels)
252
252
253
- worker.launchForTestingWith {
253
+ worker.test {
254
254
assertEquals(0 , cancels)
255
255
cancelWorker()
256
256
assertEquals(1 , cancels)
@@ -265,7 +265,7 @@ class RxWorkersTest {
265
265
val subject = SingleSubject .create<String >()
266
266
val worker = (subject as Single <out String ?>).asWorker()
267
267
268
- worker.launchForTestingWith {
268
+ worker.test {
269
269
subject.onSuccess(" foo" )
270
270
assertEquals(" foo" , nextOutput())
271
271
assertFinished()
@@ -276,7 +276,7 @@ class RxWorkersTest {
276
276
val subject = SingleSubject .create<String >()
277
277
val worker = subject.asWorker()
278
278
279
- worker.launchForTestingWith {
279
+ worker.test {
280
280
subject.onError(ExpectedException ())
281
281
assertTrue(getException() is ExpectedException )
282
282
}
@@ -290,7 +290,7 @@ class RxWorkersTest {
290
290
291
291
assertEquals(0 , subscriptions)
292
292
293
- worker.launchForTestingWith {
293
+ worker.test {
294
294
assertEquals(1 , subscriptions)
295
295
}
296
296
}
@@ -303,7 +303,7 @@ class RxWorkersTest {
303
303
304
304
assertEquals(0 , cancels)
305
305
306
- worker.launchForTestingWith {
306
+ worker.test {
307
307
assertEquals(0 , cancels)
308
308
cancelWorker()
309
309
assertEquals(1 , cancels)
@@ -318,7 +318,7 @@ class RxWorkersTest {
318
318
val subject = CompletableSubject .create()
319
319
val worker = subject.asWorker()
320
320
321
- worker.launchForTestingWith {
321
+ worker.test {
322
322
subject.onComplete()
323
323
assertFinished()
324
324
}
@@ -328,7 +328,7 @@ class RxWorkersTest {
328
328
val subject = CompletableSubject .create()
329
329
val worker = subject.asWorker()
330
330
331
- worker.launchForTestingWith {
331
+ worker.test {
332
332
subject.onError(ExpectedException ())
333
333
assertTrue(getException() is ExpectedException )
334
334
}
@@ -342,7 +342,7 @@ class RxWorkersTest {
342
342
343
343
assertEquals(0 , subscriptions)
344
344
345
- worker.launchForTestingWith {
345
+ worker.test {
346
346
assertEquals(1 , subscriptions)
347
347
}
348
348
}
@@ -355,7 +355,7 @@ class RxWorkersTest {
355
355
356
356
assertEquals(0 , cancels)
357
357
358
- worker.launchForTestingWith {
358
+ worker.test {
359
359
assertEquals(0 , cancels)
360
360
cancelWorker()
361
361
assertEquals(1 , cancels)
0 commit comments