use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testBackerNameTextViewText.
@Test
public void testBackerNameTextViewText() {
final Backing backing = BackingFactory.backing();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<String> backerNameTextViewTextTest = TestSubscriber.create();
vm.outputs.backerNameTextViewText().subscribe(backerNameTextViewTextTest);
vm.intent(intent(backing));
backerNameTextViewTextTest.assertValues(backing.backer().name());
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testRewardMinimumAndDescriptionTextViewText.
@Test
public void testRewardMinimumAndDescriptionTextViewText() {
final Reward reward = RewardFactory.reward().toBuilder().minimum(100.0f).build();
final Backing backing = BackingFactory.backing().toBuilder().reward(reward).build();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<Pair<String, String>> rewardMinimumAndDescriptionTextViewTextTest = TestSubscriber.create();
vm.outputs.rewardMinimumAndDescriptionTextViewText().subscribe(rewardMinimumAndDescriptionTextViewTextTest);
vm.intent(intent(backing));
rewardMinimumAndDescriptionTextViewTextTest.assertValues(Pair.create("$100", backing.reward().description()));
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testLoadBackerAvatar.
@Test
public void testLoadBackerAvatar() {
final Backing backing = BackingFactory.backing();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<String> loadBackerAvatarTest = TestSubscriber.create();
vm.outputs.loadBackerAvatar().subscribe(loadBackerAvatarTest);
vm.intent(intent(backing));
loadBackerAvatarTest.assertValues(backing.backer().avatar().medium());
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testGoBackOnProjectClick.
@Test
public void testGoBackOnProjectClick() {
final Backing backing = BackingFactory.backing();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<Void> goBackTest = TestSubscriber.create();
vm.outputs.goBack().subscribe(goBackTest);
vm.intent(intent(backing));
goBackTest.assertNoValues();
vm.inputs.projectClicked();
goBackTest.assertValueCount(1);
}
use of com.kickstarter.models.Backing in project android-oss by kickstarter.
the class ViewPledgeViewModelTest method testBackerNumberTextViewText.
@Test
public void testBackerNumberTextViewText() {
final Backing backing = BackingFactory.backing();
final ViewPledgeViewModel vm = vm(backing);
final TestSubscriber<String> backerNumberTextViewTextTest = TestSubscriber.create();
vm.outputs.backerNumberTextViewText().subscribe(backerNumberTextViewTextTest);
vm.intent(intent(backing));
backerNumberTextViewTextTest.assertValues(NumberUtils.format(backing.sequence()));
}
Aggregations