svn commit: r900951 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r900951 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml

lektran
Author: lektran
Date: Tue Jan 19 20:51:44 2010
New Revision: 900951

URL: http://svn.apache.org/viewvc?rev=900951&view=rev
Log:
Test case for InvoiceWorker.getInvoiceTotal(GenericValue)

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml?rev=900951&r1=900950&r2=900951&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoInvoiceTests.xml Tue Jan 19 20:51:44 2010
@@ -20,6 +20,92 @@
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="testInvoiceWorkerGetInvoiceTotal" login-required="false"
+        short-description="Tests InvoiceWorker.getInvoiceTotal(GenericValue) for all demo invoices">
+        <set field="invoiceId" value="demo10000"/>
+        <set field="amount" value="323.54" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="demo10001"/>
+        <set field="amount" value="36.43" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="demo10002"/>
+        <set field="amount" value="56.99" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="demo11000"/>
+        <set field="amount" value="20" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="demo11001"/>
+        <set field="amount" value="543.23" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="demo1200"/>
+        <set field="amount" value="511.23" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8000"/>
+        <set field="amount" value="60" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8001"/>
+        <set field="amount" value="10" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8002"/>
+        <set field="amount" value="36.43" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8003"/>
+        <set field="amount" value="46.43" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8004"/>
+        <set field="amount" value="33.99" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8100"/>
+        <set field="amount" value="1320" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8005"/>
+        <set field="amount" value="33.99" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8006"/>
+        <set field="amount" value="46.43" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8007"/>
+        <set field="amount" value="36.43" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8008"/>
+        <set field="amount" value="48" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8009"/>
+        <set field="amount" value="127.09" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+
+        <set field="invoiceId" value="8010"/>
+        <set field="amount" value="179.97" type="BigDecimal"/>
+        <call-simple-method method-name="assertInvoiceTotal"/>
+    </simple-method>
+    <simple-method method-name="assertInvoiceTotal" login-required="false"
+    short-description="Inline method to assist testInvoiceWorkerGetInvoiceTotal">
+        <entity-one value-field="invoice" entity-name="Invoice">
+            <field-map field-name="invoiceId"/>
+        </entity-one>
+        <call-class-method method-name="getInvoiceTotal" class-name="org.ofbiz.accounting.invoice.InvoiceWorker" ret-field="invoiceTotal">
+            <field field="invoice" type="GenericValue"/>
+        </call-class-method>
+        <assert><if-compare-field field="invoiceTotal" operator="equals" to-field="amount" type="BigDecimal"/></assert>
+    </simple-method>
+
     <!-- Test case for Commission Run -->
     <simple-method method-name="testCommissionRun" short-description="Test case for Commission Run" login-required="false">