use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testProjectNameTextViewText.
@Test
public void testProjectNameTextViewText() {
final Backing backing = BackingFactory.backing();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<String> projectNameTextViewTextTest = TestSubscriber.create();
vm.outputs.projectNameTextViewText().subscribe(projectNameTextViewTextTest);
vm.intent(intent(backing));
projectNameTextViewTextTest.assertValues(backing.project().name());
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testLoadProjectPhoto.
@Test
public void testLoadProjectPhoto() {
final Backing backing = BackingFactory.backing();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<String> loadProjectPhotoTest = TestSubscriber.create();
vm.outputs.loadProjectPhoto().subscribe(loadProjectPhotoTest);
vm.intent(intent(backing));
loadProjectPhotoTest.assertValues(backing.project().photo().full());
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testRewardsItemAreHidden.
@Test
public void testRewardsItemAreHidden() {
final Reward reward = RewardFactory.reward().toBuilder().rewardsItems(null).build();
final Backing backing = BackingFactory.backing().toBuilder().reward(reward).build();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<List<RewardsItem>> rewardsItemsTest = TestSubscriber.create();
vm.outputs.rewardsItems().subscribe(rewardsItemsTest);
final TestSubscriber<Boolean> rewardsItemsAreHiddenTest = TestSubscriber.create();
vm.outputs.rewardsItemsAreHidden().subscribe(rewardsItemsAreHiddenTest);
vm.intent(intent(backing));
rewardsItemsTest.assertValues(emptyList());
rewardsItemsAreHiddenTest.assertValues(true);
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testCreatorNameTextViewText.
@Test
public void testCreatorNameTextViewText() {
final Backing backing = BackingFactory.backing();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<String> creatorNameTextViewTextTest = TestSubscriber.create();
vm.outputs.creatorNameTextViewText().subscribe(creatorNameTextViewTextTest);
vm.intent(intent(backing));
creatorNameTextViewTextTest.assertValues(backing.project().creator().name());
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testRewardsItemAreEmitted.
@Test
public void testRewardsItemAreEmitted() {
final Reward reward = RewardFactory.itemized();
final Backing backing = BackingFactory.backing().toBuilder().reward(reward).build();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<List<RewardsItem>> rewardsItemsTest = TestSubscriber.create();
vm.outputs.rewardsItems().subscribe(rewardsItemsTest);
final TestSubscriber<Boolean> rewardsItemsAreHiddenTest = TestSubscriber.create();
vm.outputs.rewardsItemsAreHidden().subscribe(rewardsItemsAreHiddenTest);
vm.intent(intent(backing));
rewardsItemsTest.assertValues(reward.rewardsItems());
rewardsItemsAreHiddenTest.assertValues(false);
}
Aggregations