Search in sources :

Example 21 with MifosCurrency

use of org.mifos.application.master.business.MifosCurrency in project head by mifos.

the class CollectionSheetServiceFacadeWebTierTest method setupMifosLoggerDueToUseOfStaticClientRules.

@BeforeClass
public static void setupMifosLoggerDueToUseOfStaticClientRules() {
    defaultCurrency = new MifosCurrency(defaultCurrencyId, null, null, null);
    Money.setDefaultCurrency(defaultCurrency);
}
Also used : MifosCurrency(org.mifos.application.master.business.MifosCurrency) BeforeClass(org.junit.BeforeClass)

Example 22 with MifosCurrency

use of org.mifos.application.master.business.MifosCurrency in project head by mifos.

the class BranchReportConfigServiceIntegrationTest method testGetCurrency.

@Test
public void testGetCurrency() throws Exception {
    MifosCurrency currency = branchReportConfigService.getCurrency();
    Assert.assertNotNull(currency);
}
Also used : MifosCurrency(org.mifos.application.master.business.MifosCurrency) Test(org.junit.Test)

Example 23 with MifosCurrency

use of org.mifos.application.master.business.MifosCurrency in project head by mifos.

the class MoneyTest method testRoundRepeating.

@Test
public void testRoundRepeating() {
    MifosCurrency currency = new MifosCurrency((short) 1, "test", BigDecimal.valueOf(3.0), "USD");
    Money money = new Money(currency, "1");
    Assert.assertEquals(new Money(currency, "3"), Money.round(money, currency.getRoundingAmount(), RoundingMode.CEILING));
}
Also used : MifosCurrency(org.mifos.application.master.business.MifosCurrency) Test(org.junit.Test)

Example 24 with MifosCurrency

use of org.mifos.application.master.business.MifosCurrency in project head by mifos.

the class LoanServiceFacadeWebTierTest method setupAndInjectDependencies.

@Before
public void setupAndInjectDependencies() {
    locale = new Locale("en", "GB");
    installmentBuilder = new RepaymentScheduleInstallmentBuilder(locale);
    rupee = new MifosCurrency(Short.valueOf("1"), "Rupee", BigDecimal.valueOf(1), "INR");
    loanServiceFacade = new LoanServiceFacadeWebTier(loanDao, loanBusinessService);
}
Also used : Locale(java.util.Locale) RepaymentScheduleInstallmentBuilder(org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallmentBuilder) MifosCurrency(org.mifos.application.master.business.MifosCurrency) Before(org.junit.Before)

Example 25 with MifosCurrency

use of org.mifos.application.master.business.MifosCurrency in project head by mifos.

the class ConfigurationPersistenceIntegrationTest method testGetCurrencyForCurrencyId.

@Test
public void testGetCurrencyForCurrencyId() throws Exception {
    ConfigurationPersistence configurationPersistence = new ConfigurationPersistence();
    MifosCurrency currency = configurationPersistence.getPersistentObject(MifosCurrency.class, Short.valueOf("2"));
    Assert.assertNotNull(currency);
    Assert.assertEquals("Indian Rupee", currency.getCurrencyName());
}
Also used : MifosCurrency(org.mifos.application.master.business.MifosCurrency) Test(org.junit.Test)

Aggregations

MifosCurrency (org.mifos.application.master.business.MifosCurrency)54 Money (org.mifos.framework.util.helpers.Money)26 ArrayList (java.util.ArrayList)16 Test (org.junit.Test)12 BigDecimal (java.math.BigDecimal)10 Date (java.util.Date)10 HashMap (java.util.HashMap)10 Before (org.junit.Before)8 List (java.util.List)7 Locale (java.util.Locale)7 MifosRuntimeException (org.mifos.core.MifosRuntimeException)7 RepaymentScheduleInstallment (org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallment)5 RepaymentScheduleInstallmentBuilder (org.mifos.accounts.loan.util.helpers.RepaymentScheduleInstallmentBuilder)5 MeetingBO (org.mifos.application.meeting.business.MeetingBO)4 LocalDate (org.joda.time.LocalDate)3 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)3 PersistenceException (org.mifos.framework.exceptions.PersistenceException)3 DoubleConversionResult (org.mifos.framework.util.helpers.DoubleConversionResult)3 BigInteger (java.math.BigInteger)2 Calendar (java.util.Calendar)2