Search in sources :

Example 1 with InternalBuildEnvelope

use of com.kickstarter.services.apiresponses.InternalBuildEnvelope in project android-oss by kickstarter.

the class DiscoveryViewModelTest method testBuildCheck.

@Test
public void testBuildCheck() {
    final DiscoveryViewModel vm = new DiscoveryViewModel(environment());
    final InternalBuildEnvelope buildEnvelope = InternalBuildEnvelopeFactory.newerBuildAvailable();
    final TestSubscriber<InternalBuildEnvelope> showBuildCheckAlert = new TestSubscriber<>();
    vm.outputs.showBuildCheckAlert().subscribe(showBuildCheckAlert);
    // Build check should not be shown.
    showBuildCheckAlert.assertNoValues();
    // Build check should be shown when newer build is available.
    vm.inputs.newerBuildIsAvailable(buildEnvelope);
    showBuildCheckAlert.assertValue(buildEnvelope);
}
Also used : TestSubscriber(rx.observers.TestSubscriber) InternalBuildEnvelope(com.kickstarter.services.apiresponses.InternalBuildEnvelope) Test(org.junit.Test)

Aggregations

InternalBuildEnvelope (com.kickstarter.services.apiresponses.InternalBuildEnvelope)1 Test (org.junit.Test)1 TestSubscriber (rx.observers.TestSubscriber)1