[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[2358] trunk/sql/modules



Revision: 2358
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2358&view=rev
Author:   einhverfr
Date:     2008-10-08 05:33:55 +0000 (Wed, 08 Oct 2008)

Log Message:
-----------
Added test cases, verified data structure matches older structure

Modified Paths:
--------------
    trunk/sql/modules/Location.sql

Added Paths:
-----------
    trunk/sql/modules/test/Company.sql

Modified: trunk/sql/modules/Location.sql
===================================================================
--- trunk/sql/modules/Location.sql	2008-10-08 01:55:18 UTC (rev 2357)
+++ trunk/sql/modules/Location.sql	2008-10-08 05:33:55 UTC (rev 2358)
@@ -158,7 +158,7 @@
 	state text,
         mail_code text,
 	country text,
-	location_class text
+	class text
 );
 
 CREATE OR REPLACE FUNCTION location__get(in_id int) returns location_result AS $$

Added: trunk/sql/modules/test/Company.sql
===================================================================
--- trunk/sql/modules/test/Company.sql	                        (rev 0)
+++ trunk/sql/modules/test/Company.sql	2008-10-08 05:33:55 UTC (rev 2358)
@@ -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;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.