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


Java TestSubscriber.unsubscribe方法代碼示例

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


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

示例1: testManageSubscriptions_WithAlreadyUnsubscribedSubscription_ShouldDoNothing

import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testManageSubscriptions_WithAlreadyUnsubscribedSubscription_ShouldDoNothing()
        throws Exception {
    TestSubscriber<Void> firstSubscriber = new TestSubscriber<>();
    TestSubscriber<Void> secondSubscriber = new TestSubscriber<>();
    TestSubscriber<Void> thirdSubscriber = new TestSubscriber<>();
    firstSubscriber.unsubscribe();
    secondSubscriber.unsubscribe();
    thirdSubscriber.unsubscribe();

    mSubscriptionHandler.manageSubscriptions(firstSubscriber, secondSubscriber, thirdSubscriber);

    firstSubscriber.assertUnsubscribed();
    secondSubscriber.assertUnsubscribed();
    thirdSubscriber.assertUnsubscribed();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:17,代碼來源:RxTiPresenterSubscriptionHandlerTest.java

示例2: testManageSubscription_WithAlreadyUnsubscribedSubscription_ShouldDoNothing

import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testManageSubscription_WithAlreadyUnsubscribedSubscription_ShouldDoNothing()
        throws Exception {
    TestSubscriber<Integer> testSubscriber = new TestSubscriber<>();
    testSubscriber.unsubscribe();

    mSubscriptionHandler.manageSubscription(testSubscriber);

    testSubscriber.assertUnsubscribed();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:RxTiPresenterSubscriptionHandlerTest.java

示例3: testManageViewSubscriptions_WithOneAlreadyUnsubscribed_ShouldNotAddToSubscription

import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testManageViewSubscriptions_WithOneAlreadyUnsubscribed_ShouldNotAddToSubscription()
        throws Exception {
    mPresenter.create();
    mPresenter.attachView(mView);
    TestSubscriber<Void> firstSubscriber = new TestSubscriber<>();
    TestSubscriber<Void> secondSubscriber = new TestSubscriber<>();
    secondSubscriber.unsubscribe();

    mSubscriptionHandler.manageViewSubscriptions(firstSubscriber, secondSubscriber);

    assertThat(firstSubscriber.isUnsubscribed(), equalTo(false));
    secondSubscriber.assertUnsubscribed();
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:15,代碼來源:RxTiPresenterSubscriptionHandlerTest.java

示例4: testGlobalSubscription

import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testGlobalSubscription() throws Exception {
    TestSubscriber<Place> testObserver = TestSubscriber.create();
    RxOkuki.onAnyPlace(okuki).subscribe(testObserver);
    verify(okuki).addGlobalListener(isA(GlobalListener.class));
    testObserver.unsubscribe();
    verify(okuki).removeGlobalListener(isA(GlobalListener.class));
}
 
開發者ID:wongcain,項目名稱:okuki,代碼行數:9,代碼來源:RxOkukiTest.java

示例5: testPlaceSubscription

import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testPlaceSubscription() throws Exception {
    TestSubscriber<Place> testObserver = TestSubscriber.create();
    RxOkuki.onPlace(okuki, TestPlace.class).subscribe(testObserver);
    verify(okuki).addPlaceListener(isA(PlaceListener.class));
    testObserver.unsubscribe();
    verify(okuki).removePlaceListener(isA(PlaceListener.class));
}
 
開發者ID:wongcain,項目名稱:okuki,代碼行數:9,代碼來源:RxOkukiTest.java

示例6: testBranchSubscription

import rx.observers.TestSubscriber; //導入方法依賴的package包/類
@Test
public void testBranchSubscription() throws Exception {
    TestSubscriber<Place> testObserver = TestSubscriber.create();
    RxOkuki.onBranch(okuki, TestPlace.class).subscribe(testObserver);
    verify(okuki).addBranchListener(isA(BranchListener.class));
    testObserver.unsubscribe();
    verify(okuki).removeBranchListener(isA(BranchListener.class));
}
 
開發者ID:wongcain,項目名稱:okuki,代碼行數:9,代碼來源:RxOkukiTest.java


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