use of com.kickstarter.libs.KSCurrency in project android-oss by kickstarter.
the class KSCurrencyTest method testFormatCurrency_withUserInUK.
public void testFormatCurrency_withUserInUK() {
final KSCurrency currency = createKSCurrency("UK");
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_withUserInUKAndUSDPreferred.
public void testFormatCurrency_withUserInUKAndUSDPreferred() {
final KSCurrency currency = createKSCurrency("UK");
assertEquals("£100", currency.format(100.0f, ProjectFactory.ukProject(), false, true, RoundingMode.DOWN));
}
use of com.kickstarter.libs.KSCurrency in project android-oss by kickstarter.
the class KSCurrencyTest method testFormatCurrency_withCurrencyCodeExcluded.
public void testFormatCurrency_withCurrencyCodeExcluded() {
final KSCurrency currency = createKSCurrency("CA");
assertEquals("$100", currency.format(100.0f, ProjectFactory.project(), true));
}
use of com.kickstarter.libs.KSCurrency in project android-oss by kickstarter.
the class KSCurrencyTest method testFormatCurrency_roundsDown.
public void testFormatCurrency_roundsDown() {
final KSCurrency currency = createKSCurrency("US");
final Project project = ProjectFactory.project();
assertEquals("$100", currency.format(100.4f, project));
assertEquals("$100", currency.format(100.5f, project));
assertEquals("$101", currency.format(101.5f, project));
assertEquals("$100", currency.format(100.9f, project));
}
use of com.kickstarter.libs.KSCurrency in project android-oss by kickstarter.
the class KSCurrencyTest method testFormatCurrency_withUserInUS.
public void testFormatCurrency_withUserInUS() {
final KSCurrency currency = createKSCurrency("US");
assertEquals("$100", currency.format(100.0f, ProjectFactory.project()));
assertEquals("$100 CAD", currency.format(100.0f, ProjectFactory.caProject()));
assertEquals("£100", currency.format(100.0f, ProjectFactory.ukProject()));
}
Aggregations