diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-08 05:33:55 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-10-08 05:33:55 +0000 |
commit | b9a48112b0cdf744e954956f89f6d9d9f583aad7 (patch) | |
tree | 9e7fb44b00cdbe88416fbc6fda98266bb161662d /sql/modules/test | |
parent | 3d34f86ae52d46d07ec61dd1ced0bae41055ec13 (diff) |
Added test cases, verified data structure matches older structure
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2358 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'sql/modules/test')
-rw-r--r-- | sql/modules/test/Company.sql | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/sql/modules/test/Company.sql b/sql/modules/test/Company.sql new file mode 100644 index 00000000..fa95b32a --- /dev/null +++ b/sql/modules/test/Company.sql @@ -0,0 +1,35 @@ +BEGIN; +\i Base.sql + +INSERT INTO test_result (test_name, success) +SELECT 'Saving Company', + company_save (NULL, 'TESTING...', 1,'TESTING', 'TESTING', NULL, '1234') + IS NOT NULL; + + +INSERT INTO test_result (test_name, success) +SELECT 'Saving Credit Acct', + entity_credit_save( NULL , 1, currval('entity_id_seq')::int, 'TEST', 0, false, + 0, 0, 0, 'test-123', NULL, NULL, NULL, 'USD', now()::date, now()::date, + 0, NULL, NULL) + IS NOT NULL; + +INSERT INTO test_result (test_name, success) +SELECT 'eca_location_save', + eca__location_save(currval('entity_credit_account_id_seq')::int, NULL, 2, 'Test', 'Test', + NULL, 'Test', 'Test', '12345', 25) + IS NOT NULL; + +INSERT INTO test_result (test_name, success) +SELECT 'list_locations', count(*) > 0 + FROM eca__list_locations(currval('entity_credit_account_id_seq')::int); + + +SELECT * FROM test_result; + +SELECT (select count(*) from test_result where success is true) +|| ' tests passed and ' +|| (select count(*) from test_result where success is not true) +|| ' failed' as message; + +ROLLBACK; |