@@ -155,6 +155,30 @@ def class ObservableTests {
155
155
verify(a, times(1 )). received(" hello_2" );
156
156
}
157
157
158
+ @Test
159
+ public void testFromWithIterable () {
160
+ def list = [1 , 2 , 3 , 4 , 5 ]
161
+ assertEquals (5 , Observable . from(list). count(). toBlockingObservable(). single());
162
+ }
163
+
164
+ @Test
165
+ public void testFromWithObjects () {
166
+ def list = [1 , 2 , 3 , 4 , 5 ]
167
+ // this should now treat these as 2 objects so have a count of 2
168
+ assertEquals (2 , Observable . from(list, 6 ). count(). toBlockingObservable(). single());
169
+ }
170
+
171
+ /**
172
+ * Check that two different single arg methods are selected correctly
173
+ */
174
+ @Test
175
+ public void testStartWith () {
176
+ def list = [10 , 11 , 12 , 13 , 14 ]
177
+ def startList = [1 , 2 , 3 , 4 , 5 ]
178
+ assertEquals (6 , Observable . from(list). startWith(0 ). count(). toBlockingObservable(). single());
179
+ assertEquals (10 , Observable . from(list). startWith(startList). count(). toBlockingObservable(). single());
180
+ }
181
+
158
182
@Test
159
183
public void testScriptWithOnNext () {
160
184
new TestFactory (). getObservable(). subscribe({ result -> a. received(result)});
0 commit comments