Package billing

Examples of billing.Slip


    @Test
    public void testNormalUserNoPackageOneCall() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 1));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(2, data);
        assertEquals(Money.get(0, 60), calculator.calculate(usage));
    }
View Full Code Here


    @Test
    public void testNormalUserNoPackageOneShortMessage() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 1));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(3, data);
        assertEquals(Money.get(0, 10), calculator.calculate(usage));
    }
View Full Code Here

    @Test
    public void testNormalUserNoPackage100kData() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(4, data);
        assertEquals(Money.get(0, 50), calculator.calculate(usage));
    }
View Full Code Here

    public void testNormalUserPhoneCallPackageNoActivity() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);

        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 0));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kPackages, getPackages(PackageType.kNormalUserPhoneCall));

        UserMonthUsage usage = new UserMonthUsage(5, data);
View Full Code Here

    public void testNormalUserPhoneCallPackageWithinLimit() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);

        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 60));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kPackages, getPackages(PackageType.kNormalUserPhoneCall));

        UserMonthUsage usage = new UserMonthUsage(5, data);
View Full Code Here

    public void testNormalUserPhoneCallPackageOneMoreCall() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);

        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 61));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kPackages, getPackages(PackageType.kNormalUserPhoneCall));

        UserMonthUsage usage = new UserMonthUsage(5, data);
View Full Code Here

    public void testNormalUserShortMessagePackageWithinLimit() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);

        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 200));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kPackages, getPackages(PackageType.kNormalUserShortMessage));

        UserMonthUsage usage = new UserMonthUsage(5, data);
View Full Code Here

    public void testNormalUserShortMessagePackageOneMore() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);

        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 201));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kPackages, getPackages(PackageType.kNormalUserShortMessage));

        UserMonthUsage usage = new UserMonthUsage(5, data);
View Full Code Here

    public void testNormalUserInternetPackageWithinLimit() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);

        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 50 * 1000));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kPackages, getPackages(PackageType.kNormalUserInternet));

        UserMonthUsage usage = new UserMonthUsage(5, data);
View Full Code Here

    public void testNormalUserInternetPackage50kMore() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kNormal);

        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 50 * 1000 + 50));
        data.put(UserField.kSlips, slips);

        data.put(UserField.kPackages, getPackages(PackageType.kNormalUserInternet));

        UserMonthUsage usage = new UserMonthUsage(5, data);
View Full Code Here

TOP

Related Classes of billing.Slip

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.