corrected some tests
This commit is contained in:
@@ -42,7 +42,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
@Override
|
@Override
|
||||||
public String getNumber()
|
public String getNumber()
|
||||||
{
|
{
|
||||||
return "RE-20140703/502";
|
return "RE-20151008/504";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -111,18 +111,6 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
return new Contact();
|
return new Contact();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getTotal()
|
|
||||||
{
|
|
||||||
return new BigDecimal("496.00");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getTotalGross()
|
|
||||||
{
|
|
||||||
return new BigDecimal("571.04");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDExportableItem[] getZFItems()
|
public IZUGFeRDExportableItem[] getZFItems()
|
||||||
{
|
{
|
||||||
@@ -131,9 +119,9 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
Product balloonProduct = new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
|
Product balloonProduct = new Product("", "Luftballon: Bunt, ca. 500ml", "C62", new BigDecimal("19.000000"));
|
||||||
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
||||||
|
|
||||||
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("171.20"), new BigDecimal("1"), new BigDecimal("171.20"), designProduct);
|
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||||
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("0.94"), new BigDecimal("400"), new BigDecimal("376.04"), balloonProduct);
|
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||||
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("0.12"), new BigDecimal("200"), new BigDecimal("23.80"), airProduct);
|
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
||||||
return allItems;
|
return allItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,17 +168,15 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
class Item implements IZUGFeRDExportableItem
|
class Item implements IZUGFeRDExportableItem
|
||||||
{
|
{
|
||||||
|
|
||||||
public Item(BigDecimal price, BigDecimal priceGross, BigDecimal quantity, BigDecimal totalGross, Product product)
|
public Item(BigDecimal price, BigDecimal quantity, Product product)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
this.price = price;
|
this.price = price;
|
||||||
this.priceGross = priceGross;
|
|
||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
this.totalGross = totalGross;
|
|
||||||
this.product = product;
|
this.product = product;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BigDecimal price, priceGross, quantity, totalGross;
|
private BigDecimal price,quantity;
|
||||||
private Product product;
|
private Product product;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -204,17 +190,6 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
this.price = price;
|
this.price = price;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getPriceGross()
|
|
||||||
{
|
|
||||||
return priceGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPriceGross(BigDecimal priceGross)
|
|
||||||
{
|
|
||||||
this.priceGross = priceGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal getQuantity()
|
public BigDecimal getQuantity()
|
||||||
{
|
{
|
||||||
@@ -226,17 +201,6 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getTotalGross()
|
|
||||||
{
|
|
||||||
return totalGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalGross(BigDecimal totalGross)
|
|
||||||
{
|
|
||||||
this.totalGross = totalGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Product getProduct()
|
public Product getProduct()
|
||||||
{
|
{
|
||||||
@@ -332,7 +296,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
// //////// TESTS //////////////////////////////////////////////////////////////////////////////////////////
|
// //////// TESTS //////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20140703_502.pdf to check the values.
|
* The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20151008_504.pdf to check the values.
|
||||||
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before
|
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before
|
||||||
* testZExport
|
* testZExport
|
||||||
*
|
*
|
||||||
@@ -342,7 +306,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
public void testAImport() throws IOException
|
public void testAImport() throws IOException
|
||||||
{
|
{
|
||||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||||
zi.extractLowLevel(this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20140703_502.pdf"));
|
zi.extractLowLevel(this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20151008_504.pdf"));
|
||||||
// Reading ZUGFeRD
|
// Reading ZUGFeRD
|
||||||
|
|
||||||
String amount = null;
|
String amount = null;
|
||||||
@@ -361,7 +325,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
ref = zi.getForeignReference();
|
ref = zi.getForeignReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(amount, getTotalGross().toString());
|
assertEquals(amount, "406.82");
|
||||||
assertEquals(bic, getOwnBIC());
|
assertEquals(bic, getOwnBIC());
|
||||||
assertEquals(iban, getOwnIBAN());
|
assertEquals(iban, getOwnIBAN());
|
||||||
assertEquals(holder, getOwnOrganisationName());
|
assertEquals(holder, getOwnOrganisationName());
|
||||||
@@ -428,7 +392,7 @@ public class MustangReaderWriterEdgeTest extends TestCase implements IZUGFeRDExp
|
|||||||
ref = zi.getForeignReference();
|
ref = zi.getForeignReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(amount, getTotalGross().toString());
|
assertEquals(amount, "406.82");
|
||||||
assertEquals(bic, getOwnBIC());
|
assertEquals(bic, getOwnBIC());
|
||||||
assertEquals(iban, getOwnIBAN());
|
assertEquals(iban, getOwnIBAN());
|
||||||
assertEquals(holder, getOwnOrganisationName());
|
assertEquals(holder, getOwnOrganisationName());
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
@Override
|
@Override
|
||||||
public String getNumber()
|
public String getNumber()
|
||||||
{
|
{
|
||||||
return "RE-20140703/502";
|
return "RE-20151008/504";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -111,18 +111,6 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
return new Contact();
|
return new Contact();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getTotal()
|
|
||||||
{
|
|
||||||
return new BigDecimal("496.00");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getTotalGross()
|
|
||||||
{
|
|
||||||
return new BigDecimal("571.04");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IZUGFeRDExportableItem[] getZFItems()
|
public IZUGFeRDExportableItem[] getZFItems()
|
||||||
{
|
{
|
||||||
@@ -131,9 +119,9 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
Product balloonProduct = new Product("", "Luftballon", "C62", new BigDecimal("19.000000"));
|
Product balloonProduct = new Product("", "Luftballon", "C62", new BigDecimal("19.000000"));
|
||||||
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
Product airProduct = new Product("", "Heiße Luft pro Liter", "LTR", new BigDecimal("19.000000"));
|
||||||
|
|
||||||
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("171.20"), new BigDecimal("1"), new BigDecimal("171.20"), designProduct);
|
allItems[0] = new Item(new BigDecimal("160"), new BigDecimal("1"), designProduct);
|
||||||
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("0.94"), new BigDecimal("400"), new BigDecimal("376.04"), balloonProduct);
|
allItems[1] = new Item(new BigDecimal("0.79"), new BigDecimal("400"), balloonProduct);
|
||||||
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("0.12"), new BigDecimal("200"), new BigDecimal("23.80"), airProduct);
|
allItems[2] = new Item(new BigDecimal("0.10"), new BigDecimal("200"), airProduct);
|
||||||
return allItems;
|
return allItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,17 +168,15 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
class Item implements IZUGFeRDExportableItem
|
class Item implements IZUGFeRDExportableItem
|
||||||
{
|
{
|
||||||
|
|
||||||
public Item(BigDecimal price, BigDecimal priceGross, BigDecimal quantity, BigDecimal totalGross, Product product)
|
public Item(BigDecimal price, BigDecimal quantity, Product product)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
this.price = price;
|
this.price = price;
|
||||||
this.priceGross = priceGross;
|
|
||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
this.totalGross = totalGross;
|
|
||||||
this.product = product;
|
this.product = product;
|
||||||
}
|
}
|
||||||
|
|
||||||
private BigDecimal price, priceGross, quantity, totalGross;
|
private BigDecimal price, quantity;
|
||||||
private Product product;
|
private Product product;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -204,17 +190,6 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
this.price = price;
|
this.price = price;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getPriceGross()
|
|
||||||
{
|
|
||||||
return priceGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPriceGross(BigDecimal priceGross)
|
|
||||||
{
|
|
||||||
this.priceGross = priceGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BigDecimal getQuantity()
|
public BigDecimal getQuantity()
|
||||||
{
|
{
|
||||||
@@ -226,17 +201,6 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
this.quantity = quantity;
|
this.quantity = quantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal getTotalGross()
|
|
||||||
{
|
|
||||||
return totalGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTotalGross(BigDecimal totalGross)
|
|
||||||
{
|
|
||||||
this.totalGross = totalGross;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Product getProduct()
|
public Product getProduct()
|
||||||
{
|
{
|
||||||
@@ -332,7 +296,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
// //////// TESTS //////////////////////////////////////////////////////////////////////////////////////////
|
// //////// TESTS //////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20140703_502.pdf to check the values.
|
* The importer test imports from ./src/test/MustangGnuaccountingBeispielRE-20151008_504.pdf to check the values.
|
||||||
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before
|
* --> as only Name Ascending is supported for Test Unit sequence, I renamed the this test-A-Export to run before
|
||||||
* testZExport
|
* testZExport
|
||||||
*
|
*
|
||||||
@@ -342,7 +306,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
public void testAImport() throws IOException
|
public void testAImport() throws IOException
|
||||||
{
|
{
|
||||||
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
ZUGFeRDImporter zi = new ZUGFeRDImporter();
|
||||||
InputStream inputStream = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20140703_502.pdf");
|
InputStream inputStream = this.getClass().getResourceAsStream("/MustangGnuaccountingBeispielRE-20151008_504.pdf");
|
||||||
zi.extractLowLevel(inputStream);
|
zi.extractLowLevel(inputStream);
|
||||||
// Reading ZUGFeRD
|
// Reading ZUGFeRD
|
||||||
|
|
||||||
@@ -362,7 +326,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
ref = zi.getForeignReference();
|
ref = zi.getForeignReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(amount, getTotalGross().toString());
|
assertEquals(amount, "406.82");
|
||||||
assertEquals(bic, getOwnBIC());
|
assertEquals(bic, getOwnBIC());
|
||||||
assertEquals(iban, getOwnIBAN());
|
assertEquals(iban, getOwnIBAN());
|
||||||
assertEquals(holder, getOwnOrganisationName());
|
assertEquals(holder, getOwnOrganisationName());
|
||||||
@@ -428,7 +392,7 @@ public class MustangReaderWriterTest extends TestCase implements IZUGFeRDExporta
|
|||||||
ref = zi.getForeignReference();
|
ref = zi.getForeignReference();
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(amount, getTotalGross().toString());
|
assertEquals(amount, "406.82");
|
||||||
assertEquals(bic, getOwnBIC());
|
assertEquals(bic, getOwnBIC());
|
||||||
assertEquals(iban, getOwnIBAN());
|
assertEquals(iban, getOwnIBAN());
|
||||||
assertEquals(holder, getOwnOrganisationName());
|
assertEquals(holder, getOwnOrganisationName());
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user