Search in sources :

Example 1 with MockCurrentConfig

use of com.kickstarter.mock.MockCurrentConfig in project android-oss by kickstarter.

the class FacebookConfimationViewModelTest method testToggleSendNewsLetter_isNotChecked.

@Test
public void testToggleSendNewsLetter_isNotChecked() {
    final CurrentConfigType currentConfig = new MockCurrentConfig();
    currentConfig.config(ConfigFactory.config().toBuilder().countryCode("US").build());
    final Environment environment = environment().toBuilder().currentConfig(currentConfig).build();
    this.vm = new FacebookConfirmationViewModel.ViewModel(environment);
    this.vm.outputs.sendNewslettersIsChecked().subscribe(this.sendNewslettersIsChecked);
    this.sendNewslettersIsChecked.assertValue(false);
    this.vm.inputs.sendNewslettersClick(true);
    this.vm.inputs.sendNewslettersClick(false);
    this.sendNewslettersIsChecked.assertValues(false, true, false);
}
Also used : MockCurrentConfig(com.kickstarter.mock.MockCurrentConfig) CurrentConfigType(com.kickstarter.libs.CurrentConfigType) Environment(com.kickstarter.libs.Environment) Test(org.junit.Test)

Example 2 with MockCurrentConfig

use of com.kickstarter.mock.MockCurrentConfig in project android-oss by kickstarter.

the class KSCurrencyTest method createKSCurrency.

private static KSCurrency createKSCurrency(final String countryCode) {
    final Config config = ConfigFactory.config().toBuilder().countryCode(countryCode).build();
    final CurrentConfigType currentConfig = new MockCurrentConfig();
    currentConfig.config(config);
    return new KSCurrency(currentConfig);
}
Also used : MockCurrentConfig(com.kickstarter.mock.MockCurrentConfig) KSCurrency(com.kickstarter.libs.KSCurrency) MockCurrentConfig(com.kickstarter.mock.MockCurrentConfig) Config(com.kickstarter.libs.Config) CurrentConfigType(com.kickstarter.libs.CurrentConfigType)

Aggregations

CurrentConfigType (com.kickstarter.libs.CurrentConfigType)2 MockCurrentConfig (com.kickstarter.mock.MockCurrentConfig)2 Config (com.kickstarter.libs.Config)1 Environment (com.kickstarter.libs.Environment)1 KSCurrency (com.kickstarter.libs.KSCurrency)1 Test (org.junit.Test)1