本文整理匯總了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();
}
示例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();
}
示例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();
}
示例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));
}
示例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));
}
示例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));
}