use of com.kickstarter.libs.KSCurrency in project android-oss by kickstarter.
the class KSCurrencyTest method testFormatCurrency_withUserInUnlaunchedCountry.
public void testFormatCurrency_withUserInUnlaunchedCountry() {
final KSCurrency currency = createKSCurrency("XX");
assertEquals("$100 USD", currency.format(100.0f, ProjectFactory.project()));
assertEquals("$100 CAD", currency.format(100.0f, ProjectFactory.caProject()));
assertEquals("£100", currency.format(100.0f, ProjectFactory.ukProject()));
}
use of com.kickstarter.libs.KSCurrency 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);
}
use of com.kickstarter.libs.KSCurrency in project android-oss by kickstarter.
the class KSCurrencyTest method testFormatCurrency_withUserInCA.
public void testFormatCurrency_withUserInCA() {
final KSCurrency currency = createKSCurrency("CA");
assertEquals("$100 USD", currency.format(100.0f, ProjectFactory.project()));
assertEquals("$100 CAD", currency.format(100.0f, ProjectFactory.caProject()));
assertEquals("£100", currency.format(100.0f, ProjectFactory.ukProject()));
}
use of com.kickstarter.libs.KSCurrency in project android-oss by kickstarter.
the class KSCurrencyTest method testFormatCurrency_withUserInUSAndUSDPreferred.
public void testFormatCurrency_withUserInUSAndUSDPreferred() {
final KSCurrency currency = createKSCurrency("US");
assertEquals("$150", currency.format(100.0f, ProjectFactory.ukProject(), false, true, RoundingMode.DOWN));
}
Aggregations