use of org.mifos.application.master.business.MifosCurrency in project head by mifos.
the class RepaymentScheduleInstallmentTest method setUp.
@Before
public void setUp() throws Exception {
locale = new Locale("en", "GB");
installmentBuilder = new RepaymentScheduleInstallmentBuilder(locale);
rupee = new MifosCurrency(Short.valueOf("1"), "Rupee", BigDecimal.valueOf(1), "INR");
}
use of org.mifos.application.master.business.MifosCurrency in project head by mifos.
the class LoanAccountServiceFacadeWebTierTest method setupAndInjectDependencies.
@Before
public void setupAndInjectDependencies() {
loanAccountServiceFacade = new LoanAccountServiceFacadeWebTier(officeDao, loanProductDao, customerDao, personnelDao, fundDao, loanDao, accountService, scheduleCalculatorAdaptor, loanBusinessService, loanScheduleService, installmentsValidator, holidayServiceFacade, monthClosingServiceFacade, customerPersistence, configurationPersistence, clientServiceFacade, savingsServiceFacade);
((LoanAccountServiceFacadeWebTier) loanAccountServiceFacade).setTransactionHelper(hibernateTransactionHelper);
rupee = new MifosCurrency(Short.valueOf("1"), "Rupee", BigDecimal.valueOf(1), "INR");
userContext = TestUtils.makeUser();
}
use of org.mifos.application.master.business.MifosCurrency in project head by mifos.
the class WebTierAccountServiceFacadeTest method setUp.
@Before
public void setUp() throws Exception {
accountServiceFacade = new WebTierAccountServiceFacade(null, transactionHelper, accountBusinessService, scheduleCalculatorAdaptor, acceptedPaymentTypePersistence, personnelPersistence, legacyAccountDao, monthClosingServiceFacade, clientServiceFacade, savingsServiceFacade) {
@Override
void clearSessionAndRollback() {
// do nothing
}
@Override
UserContext getUserContext() {
return userContext;
}
};
rupee = new MifosCurrency(Short.valueOf("1"), "Rupee", BigDecimal.valueOf(1), "INR");
}
use of org.mifos.application.master.business.MifosCurrency in project head by mifos.
the class CollectionSheetDtoTranslatorImplTest method setupStaticClientRules.
@BeforeClass
public static void setupStaticClientRules() {
defaultCurrency = new MifosCurrency(defaultCurrencyId, null, null, null);
Money.setDefaultCurrency(defaultCurrency);
}
use of org.mifos.application.master.business.MifosCurrency in project head by mifos.
the class LocalizationConverterTest method testParseDoubleForCashFlowValidations.
@Test
public void testParseDoubleForCashFlowValidations() {
MifosCurrency mifosCurrency = new MifosCurrency(Short.valueOf("1"), "Rupee", BigDecimal.valueOf(1), "INR");
LocalizationConverter localizationConverter = new LocalizationConverter(mifosCurrency);
DoubleConversionResult result = parseForCashFlow(localizationConverter, "22.59");
assertThat(result.getDoubleValue(), is(22.59));
result = parseForCashFlow(localizationConverter, "222,59562");
assertThat(result.getErrors().get(0), is(ConversionError.NOT_ALL_NUMBER));
result = parseForCashFlow(localizationConverter, "2a5922");
assertThat(result.getErrors().get(0), is(ConversionError.NOT_ALL_NUMBER));
result = parseForCashFlow(localizationConverter, "22222222222.5");
assertThat(result.getErrors().get(0), is(ConversionError.EXCEEDING_NUMBER_OF_DIGITS_BEFORE_DECIMAL_SEPARATOR_FOR_CASHFLOW_VALIDATION));
result = parseForCashFlow(localizationConverter, "222.595690");
assertThat(result.getErrors().get(0), is(ConversionError.EXCEEDING_NUMBER_OF_DIGITS_AFTER_DECIMAL_SEPARATOR_FOR_CASHFLOW_VALIDATION));
result = parseForCashFlow(localizationConverter, "222.59");
assertThat(result.getErrors().get(0), is(ConversionError.CASH_FLOW_THRESHOLD_OUT_OF_RANGE));
}
Aggregations