@@ -0,0 +1,1975 @@
+/*%0A * Copyright 2010-2012 Ning, Inc.%0A *%0A * Ning licenses this file to you under the Apache License, version 2.0%0A * (the %22License%22); you may not use this file except in compliance with the%0A * License.  You may obtain a copy of the License at:%0A *%0A *    http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A */%0A%0Apackage com.ning.billing.invoice.model;%0A%0Aimport java.math.BigDecimal;%0Aimport java.util.List;%0A%0Aimport org.joda.time.DateTimeZone;%0Aimport org.joda.time.LocalDate;%0Aimport org.testng.Assert;%0Aimport org.testng.annotations.Test;%0A%0Aimport com.ning.billing.catalog.api.BillingPeriod;%0A%0Apublic class TestInAdvanceBillingMode %7B%0A%0A    @Test(groups = %22fast%22)%0A    public void testCalculateSimpleInvoiceItem() throws Exception %7B%0A        final InAdvanceBillingMode billingMode = new InAdvanceBillingMode();%0A        final LocalDate startDate = new LocalDate(2012, 7, 16);%0A        final LocalDate endDate = new LocalDate(2012, 8, 16);%0A        final LocalDate targetDate = new LocalDate(2012, 7, 16);%0A        final DateTimeZone dateTimeZone = DateTimeZone.forID(%22Pacific/Pitcairn%22);%0A        final int billingCycleDayLocal = 16;%0A        final BillingPeriod billingPeriod = BillingPeriod.MONTHLY;%0A%0A        final List%3CRecurringInvoiceItemData%3E invoiceItems = billingMode.calculateInvoiceItemData(startDate, endDate, targetDate, dateTimeZone, billingCycleDayLocal, billingPeriod);%0A        Assert.assertEquals(invoiceItems.size(), 1);%0A        Assert.assertEquals(invoiceItems.get(0).getStartDate(), startDate);%0A        Assert.assertEquals(invoiceItems.get(0).getEndDate(), endDate);%0A        Assert.assertEquals(invoiceItems.get(0).getNumberOfCycles(), BigDecimal.ONE);%0A    %7D%0A%7D%0A

add simple test for InAdvanceBillingMode