Java Code Examples for io.reactivex.rxjava3.subscribers.TestSubscriber#assertNotComplete()

The following examples show how to use io.reactivex.rxjava3.subscribers.TestSubscriber#assertNotComplete() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UntilCorrespondingEventTransformerFlowableTest.java    From RxLifecycle with Apache License 2.0 5 votes vote down vote up
@Test
public void noEvents() {
    TestSubscriber<String> testSubscriber = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle, CORRESPONDING_EVENTS))
        .test();

    stream.onNext("1");
    stream.onNext("2");
    testSubscriber.assertValues("1", "2");
    testSubscriber.assertNotComplete();
}
 
Example 2
Source File: UntilCorrespondingEventTransformerFlowableTest.java    From RxLifecycle with Apache License 2.0 5 votes vote down vote up
@Test
public void oneStartEvent() {
    TestSubscriber<String> testSubscriber = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle, CORRESPONDING_EVENTS))
        .test();

    lifecycle.onNext("create");
    stream.onNext("1");
    stream.onNext("2");

    testSubscriber.assertValues("1", "2");
    testSubscriber.assertNotComplete();
}
 
Example 3
Source File: UntilCorrespondingEventTransformerFlowableTest.java    From RxLifecycle with Apache License 2.0 5 votes vote down vote up
@Test
public void twoOpenEvents() {
    TestSubscriber<String> testSubscriber = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle, CORRESPONDING_EVENTS))
        .test();

    lifecycle.onNext("create");
    stream.onNext("1");
    lifecycle.onNext("start");
    stream.onNext("2");

    testSubscriber.assertValues("1", "2");
    testSubscriber.assertNotComplete();
}
 
Example 4
Source File: UntilLifecycleTransformerFlowableTest.java    From RxLifecycle with Apache License 2.0 5 votes vote down vote up
@Test
public void noEvent() {
    TestSubscriber<String> testSubscriber = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle))
        .test();

    stream.onNext("1");
    stream.onNext("2");
    testSubscriber.assertValues("1", "2");
    testSubscriber.assertNotComplete();
}
 
Example 5
Source File: UntilEventTransformerFlowableTest.java    From RxLifecycle with Apache License 2.0 5 votes vote down vote up
@Test
public void noEvents() {
    TestSubscriber<String> testSubscriber = stream
        .compose(RxLifecycle.<String, String>bindUntilEvent(lifecycle, "stop"))
        .test();

    stream.onNext("1");
    stream.onNext("2");
    testSubscriber.assertValues("1", "2");
    testSubscriber.assertNotComplete();
}
 
Example 6
Source File: UntilEventTransformerFlowableTest.java    From RxLifecycle with Apache License 2.0 5 votes vote down vote up
@Test
public void oneWrongEvent() {
    TestSubscriber<String> testSubscriber = stream
        .compose(RxLifecycle.<String, String>bindUntilEvent(lifecycle, "stop"))
        .test();

    stream.onNext("1");
    lifecycle.onNext("keep going");
    stream.onNext("2");

    testSubscriber.assertValues("1", "2");
    testSubscriber.assertNotComplete();
}