當前位置: 首頁>>代碼示例>>Java>>正文


Java TestObserver.assertNotTerminated方法代碼示例

本文整理匯總了Java中io.reactivex.observers.TestObserver.assertNotTerminated方法的典型用法代碼示例。如果您正苦於以下問題:Java TestObserver.assertNotTerminated方法的具體用法?Java TestObserver.assertNotTerminated怎麽用?Java TestObserver.assertNotTerminated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.reactivex.observers.TestObserver的用法示例。


在下文中一共展示了TestObserver.assertNotTerminated方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: noEvents

import io.reactivex.observers.TestObserver; //導入方法依賴的package包/類
@Test
public void noEvents() {
    TestObserver<String> testObserver = stream
        .compose(RxLifecycle.<String, String>bindUntilEvent(lifecycle, "stop"))
        .test();

    stream.onNext("1");
    stream.onNext("2");
    testObserver.assertValues("1", "2");
    testObserver.assertNotTerminated();
}
 
開發者ID:xufreshman,項目名稱:RxLifeCycle,代碼行數:12,代碼來源:UntilEventTransformerObservableTest.java

示例2: oneWrongEvent

import io.reactivex.observers.TestObserver; //導入方法依賴的package包/類
@Test
public void oneWrongEvent() {
    TestObserver<String> testObserver = stream
        .compose(RxLifecycle.<String, String>bindUntilEvent(lifecycle, "stop"))
        .test();

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

    testObserver.assertValues("1", "2");
    testObserver.assertNotTerminated();
}
 
開發者ID:xufreshman,項目名稱:RxLifeCycle,代碼行數:14,代碼來源:UntilEventTransformerObservableTest.java

示例3: noEvent

import io.reactivex.observers.TestObserver; //導入方法依賴的package包/類
@Test
public void noEvent() {
    TestObserver<String> testObserver = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle))
        .test();

    stream.onNext("1");
    stream.onNext("2");
    testObserver.assertValues("1", "2");
    testObserver.assertNotTerminated();
}
 
開發者ID:xufreshman,項目名稱:RxLifeCycle,代碼行數:12,代碼來源:UntilLifecycleTransformerObservableTest.java

示例4: noEvents

import io.reactivex.observers.TestObserver; //導入方法依賴的package包/類
@Test
public void noEvents() {
    TestObserver<String> testObserver = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle, CORRESPONDING_EVENTS))
        .test();

    stream.onNext("1");
    stream.onNext("2");
    testObserver.assertValues("1", "2");
    testObserver.assertNotTerminated();
}
 
開發者ID:xufreshman,項目名稱:RxLifeCycle,代碼行數:12,代碼來源:UntilCorrespondingEventTransformerObservableTest.java

示例5: oneStartEvent

import io.reactivex.observers.TestObserver; //導入方法依賴的package包/類
@Test
public void oneStartEvent() {
    TestObserver<String> testObserver = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle, CORRESPONDING_EVENTS))
        .test();

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

    testObserver.assertValues("1", "2");
    testObserver.assertNotTerminated();
}
 
開發者ID:xufreshman,項目名稱:RxLifeCycle,代碼行數:14,代碼來源:UntilCorrespondingEventTransformerObservableTest.java

示例6: twoOpenEvents

import io.reactivex.observers.TestObserver; //導入方法依賴的package包/類
@Test
public void twoOpenEvents() {
    TestObserver<String> testObserver = stream
        .compose(RxLifecycle.<String, String>bind(lifecycle, CORRESPONDING_EVENTS))
        .test();

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

    testObserver.assertValues("1", "2");
    testObserver.assertNotTerminated();
}
 
開發者ID:xufreshman,項目名稱:RxLifeCycle,代碼行數:15,代碼來源:UntilCorrespondingEventTransformerObservableTest.java


注:本文中的io.reactivex.observers.TestObserver.assertNotTerminated方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。