summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/administration_rw_tests.cpp14
-rw-r--r--tests/administration_validation_tests.cpp40
-rw-r--r--tests/test_helper.cpp20
3 files changed, 37 insertions, 37 deletions
diff --git a/tests/administration_rw_tests.cpp b/tests/administration_rw_tests.cpp
index 2a009e4..b610948 100644
--- a/tests/administration_rw_tests.cpp
+++ b/tests/administration_rw_tests.cpp
@@ -110,10 +110,10 @@ TEST _administration_rw_contact(void)
{
pw = administration::contact_create_empty();
strops::copy(pw.name, "John Johnsson", sizeof(pw.name));
- strops::copy(pw.address.address1, "Address 1", sizeof(pw.address.address1));
- strops::copy(pw.address.country_code, "FR", sizeof(pw.address.country_code));
- strops::copy(pw.address.city, "Paris", sizeof(pw.address.city));
- strops::copy(pw.address.postal, "12345", sizeof(pw.address.postal));
+ strops::copy(pw.addr.address1, "Address 1", sizeof(pw.addr.address1));
+ strops::copy(pw.addr.country_code, "FR", sizeof(pw.addr.country_code));
+ strops::copy(pw.addr.city, "Paris", sizeof(pw.addr.city));
+ strops::copy(pw.addr.postal, "12345", sizeof(pw.addr.postal));
strops::copy(pw.email, "test@test.com", sizeof(pw.email));
pw.type = contact_type::CONTACT_CONSUMER;
@@ -173,8 +173,8 @@ TEST _assert_invoices_are_equal(invoice inv, invoice invr)
ASSERT_EQ(invr.issued_at, inv.issued_at);
ASSERT_EQ(invr.expires_at, inv.expires_at);
ASSERT_EQ(invr.delivered_at, inv.delivered_at);
- ASSERT_STR_EQ(invr.document.original_path, inv.document.original_path);
- ASSERT_STR_EQ(invr.document.copy_path, inv.document.copy_path);
+ ASSERT_STR_EQ(invr.orig_document.original_path, inv.orig_document.original_path);
+ ASSERT_STR_EQ(invr.orig_document.copy_path, inv.orig_document.copy_path);
ASSERT_STR_EQ(invr.project_id, inv.project_id);
ASSERT_STR_EQ(invr.cost_center_id, inv.cost_center_id);
@@ -324,7 +324,7 @@ TEST _administration_rw_b2b2c_invoice(void)
inv.supplier = _create_nl_business();
inv.customer = _create_nl_business();
strops::copy(inv.addressee.name, "Piet Pinda", sizeof(inv.addressee.name));
- inv.addressee.address = _create_nl_consumer().address;
+ inv.addressee.addr = _create_nl_consumer().addr;
inv.is_triangulation = 1;
inv.is_outgoing = 1;
inv.issued_at = time(NULL);
diff --git a/tests/administration_validation_tests.cpp b/tests/administration_validation_tests.cpp
index cd2aa0c..aae7007 100644
--- a/tests/administration_validation_tests.cpp
+++ b/tests/administration_validation_tests.cpp
@@ -148,10 +148,10 @@ contact _create_test_contact()
{
contact p1 = administration::contact_create_empty();
strops::copy(p1.name, "John Johnsson", sizeof(p1.name));
- strops::copy(p1.address.address1, "Address 1", sizeof(p1.address.address1));
- strops::copy(p1.address.country_code, "FR", sizeof(p1.address.country_code));
- strops::copy(p1.address.city, "Paris", sizeof(p1.address.city));
- strops::copy(p1.address.postal, "12345", sizeof(p1.address.postal));
+ strops::copy(p1.addr.address1, "Address 1", sizeof(p1.addr.address1));
+ strops::copy(p1.addr.country_code, "FR", sizeof(p1.addr.country_code));
+ strops::copy(p1.addr.city, "Paris", sizeof(p1.addr.city));
+ strops::copy(p1.addr.postal, "12345", sizeof(p1.addr.postal));
strops::copy(p1.email, "test@test.com", sizeof(p1.email));
p1.type = contact_type::CONTACT_CONSUMER;
return p1;
@@ -166,13 +166,13 @@ TEST _administration_validate_contact_add(void)
strops::copy(p1.name, "", sizeof(p1.name));
ASSERT_EQ(administration::contact_add(p1), A_ERR_MISSING_NAME);
- strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
+ strops::copy(p1.addr.address1, "", sizeof(p1.addr.address1));
ASSERT_EQ(administration::contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops::copy(p1.address.city, "", sizeof(p1.address.city));
+ strops::copy(p1.addr.city, "", sizeof(p1.addr.city));
ASSERT_EQ(administration::contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
+ strops::copy(p1.addr.postal, "", sizeof(p1.addr.postal));
ASSERT_EQ(administration::contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
+ strops::copy(p1.addr.country_code, "", sizeof(p1.addr.country_code));
ASSERT_EQ(administration::contact_add(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
p1.type = contact_type::CONTACT_BUSINESS;
@@ -192,13 +192,13 @@ TEST _administration_validate_contact_update(void)
strops::copy(p1.name, "", sizeof(p1.name));
ASSERT_EQ(administration::contact_update(p1), A_ERR_MISSING_NAME);
- strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
+ strops::copy(p1.addr.address1, "", sizeof(p1.addr.address1));
ASSERT_EQ(administration::contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops::copy(p1.address.city, "", sizeof(p1.address.city));
+ strops::copy(p1.addr.city, "", sizeof(p1.addr.city));
ASSERT_EQ(administration::contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
+ strops::copy(p1.addr.postal, "", sizeof(p1.addr.postal));
ASSERT_EQ(administration::contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
+ strops::copy(p1.addr.country_code, "", sizeof(p1.addr.country_code));
ASSERT_EQ(administration::contact_update(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
p1.type = contact_type::CONTACT_BUSINESS;
@@ -207,10 +207,10 @@ TEST _administration_validate_contact_update(void)
strops::copy(p1.id, "-1", sizeof(p1.id));
strops::copy(p1.name, "John Johnsson", sizeof(p1.name));
- strops::copy(p1.address.address1, "Address 1", sizeof(p1.address.address1));
- strops::copy(p1.address.country_code, "FR", sizeof(p1.address.country_code));
- strops::copy(p1.address.city, "Paris", sizeof(p1.address.city));
- strops::copy(p1.address.postal, "12345", sizeof(p1.address.postal));
+ strops::copy(p1.addr.address1, "Address 1", sizeof(p1.addr.address1));
+ strops::copy(p1.addr.country_code, "FR", sizeof(p1.addr.country_code));
+ strops::copy(p1.addr.city, "Paris", sizeof(p1.addr.city));
+ strops::copy(p1.addr.postal, "12345", sizeof(p1.addr.postal));
p1.type = contact_type::CONTACT_CONSUMER;
ASSERT_EQ(administration::contact_update(p1), A_ERR_NOT_FOUND);
@@ -243,13 +243,13 @@ TEST _administration_validate_contact_isvalid(void)
strops::copy(p1.name, "", sizeof(p1.name));
ASSERT_EQ(administration::contact_is_valid(p1), A_ERR_MISSING_NAME);
- strops::copy(p1.address.address1, "", sizeof(p1.address.address1));
+ strops::copy(p1.addr.address1, "", sizeof(p1.addr.address1));
ASSERT_EQ(administration::contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1);
- strops::copy(p1.address.city, "", sizeof(p1.address.city));
+ strops::copy(p1.addr.city, "", sizeof(p1.addr.city));
ASSERT_EQ(administration::contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY);
- strops::copy(p1.address.postal, "", sizeof(p1.address.postal));
+ strops::copy(p1.addr.postal, "", sizeof(p1.addr.postal));
ASSERT_EQ(administration::contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL);
- strops::copy(p1.address.country_code, "", sizeof(p1.address.country_code));
+ strops::copy(p1.addr.country_code, "", sizeof(p1.addr.country_code));
ASSERT_EQ(administration::contact_is_valid(p1), A_ERR_MISSING_NAME|A_ERR_MISSING_ADDRESS1|A_ERR_MISSING_CITY|A_ERR_MISSING_POSTAL|A_ERR_MISSING_COUNTRYCODE);
p1.type = contact_type::CONTACT_BUSINESS;
diff --git a/tests/test_helper.cpp b/tests/test_helper.cpp
index ada084b..9dc9898 100644
--- a/tests/test_helper.cpp
+++ b/tests/test_helper.cpp
@@ -19,11 +19,11 @@ static contact _create_nl_business()
{
contact pw = administration::contact_create_empty();
strops::copy(pw.name, "Dutch Company BV", sizeof(pw.name));
- strops::copy(pw.address.address1, "Address 1", sizeof(pw.address.address1));
- strops::copy(pw.address.country_code, "NL", sizeof(pw.address.country_code));
- strops::copy(pw.address.city, "Amsterdam", sizeof(pw.address.city));
- strops::copy(pw.address.region, "Noord-Holland", sizeof(pw.address.region));
- strops::copy(pw.address.postal, "1234AA", sizeof(pw.address.postal));
+ strops::copy(pw.addr.address1, "Address 1", sizeof(pw.addr.address1));
+ strops::copy(pw.addr.country_code, "NL", sizeof(pw.addr.country_code));
+ strops::copy(pw.addr.city, "Amsterdam", sizeof(pw.addr.city));
+ strops::copy(pw.addr.region, "Noord-Holland", sizeof(pw.addr.region));
+ strops::copy(pw.addr.postal, "1234AA", sizeof(pw.addr.postal));
strops::copy(pw.taxid, "T123", sizeof(pw.taxid));
strops::copy(pw.businessid, "B321", sizeof(pw.businessid));
strops::copy(pw.email, "test@test.com", sizeof(pw.email));
@@ -37,11 +37,11 @@ static contact _create_nl_consumer()
{
contact pw = administration::contact_create_empty();
strops::copy(pw.name, "Piet Pinda", sizeof(pw.name));
- strops::copy(pw.address.address1, "Address 2", sizeof(pw.address.address1));
- strops::copy(pw.address.country_code, "NL", sizeof(pw.address.country_code));
- strops::copy(pw.address.city, "Maastricht", sizeof(pw.address.city));
- strops::copy(pw.address.region, "Limburg", sizeof(pw.address.region));
- strops::copy(pw.address.postal, "4321AA", sizeof(pw.address.postal));
+ strops::copy(pw.addr.address1, "Address 2", sizeof(pw.addr.address1));
+ strops::copy(pw.addr.country_code, "NL", sizeof(pw.addr.country_code));
+ strops::copy(pw.addr.city, "Maastricht", sizeof(pw.addr.city));
+ strops::copy(pw.addr.region, "Limburg", sizeof(pw.addr.region));
+ strops::copy(pw.addr.postal, "4321AA", sizeof(pw.addr.postal));
strops::copy(pw.email, "test@test.com", sizeof(pw.email));
strops::copy(pw.phone_number, "+317654321", sizeof(pw.phone_number));
pw.type = contact_type::CONTACT_CONSUMER;