Package org.joda.time

Examples of org.joda.time.LocalDateTime


    public void testVipUserNoPackageOneMessage() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 1));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(60, 10), calculator.calculate(usage));
    }
View Full Code Here


    public void testVipUserNoPackage50kInternet() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 50));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(60, 15), calculator.calculate(usage));
    }
View Full Code Here

    public void testVipUserNoPackageAllThree() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 10));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 15));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(65, 80), calculator.calculate(usage));
    }
View Full Code Here

    public void testVipUserNoPackageAllThree31Days() {
        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 31);
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 10));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 15));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(67, 80), calculator.calculate(usage));
    }
View Full Code Here

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage1));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 750));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 200));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(100, 0), calculator.calculate(usage));
    }
View Full Code Here

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage1));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 751));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 200));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(100, 30), calculator.calculate(usage));
    }
View Full Code Here

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage1));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 750));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 201));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(100, 10), calculator.calculate(usage));
    }
View Full Code Here

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage1));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 750));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 200));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000 + 50));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(100, 5), calculator.calculate(usage));
    }
View Full Code Here

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage1));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 751));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 201));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 100 * 1000 + 50));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(100, 45), calculator.calculate(usage));
    }
View Full Code Here

        Map<UserField, Object> data = new HashMap<UserField, Object>();
        data.put(UserField.kUserType, UserType.kVip);
        data.put(UserField.kDaysServed, 30);
        data.put(UserField.kPackages, getPackages(PackageType.kVipUserPackage2));
        List<Slip> slips = new ArrayList<Slip>();
        slips.add(new Slip(SlipType.kPhoneCall, new LocalDateTime(), 2000));
        slips.add(new Slip(SlipType.kShortMessage, new LocalDateTime(), 500));
        slips.add(new Slip(SlipType.kInternet, new LocalDateTime(), 300 * 1000));
        data.put(UserField.kSlips, slips);
        UserMonthUsage usage = new UserMonthUsage(1, data);
        assertEquals(Money.get(200, 0), calculator.calculate(usage));
    }
View Full Code Here

TOP

Related Classes of org.joda.time.LocalDateTime

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.