[Pypersyst-cvs] sandbox/jshprentz/demos/family/model/tests test_personTransactions.py,1.3,1.4
Brought to you by:
pobrien
From: <jsh...@us...> - 2003-03-28 06:18:32
|
Update of /cvsroot/pypersyst/sandbox/jshprentz/demos/family/model/tests In directory sc8-pr-cvs1:/tmp/cvs-serv27289/tests Modified Files: test_personTransactions.py Log Message: Added update person name transaction. Index: test_personTransactions.py =================================================================== RCS file: /cvsroot/pypersyst/sandbox/jshprentz/demos/family/model/tests/test_personTransactions.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_personTransactions.py 25 Jan 2003 03:48:21 -0000 1.3 --- test_personTransactions.py 28 Mar 2003 06:18:24 -0000 1.4 *************** *** 99,102 **** --- 99,130 ---- + class GetUpdateNameTestCase(unittest.TestCase): + + def setUp(self): + pass + + def tearDown(self): + pass + + def test___init__(self): + aTransaction = personTransactions.UpdateName (123, "John", "Smith") + self.assertEqual ( + aTransaction.__class__, + personTransactions.UpdateName) + self.assertEqual (aTransaction.personID, 123) + self.assertEqual (aTransaction.firstName, "John") + self.assertEqual (aTransaction.lastName, "Smith") + + def test_execute(self): + system = personManager.PersonManager () + person1 = system.newPerson () + transaction1 = personTransactions.UpdateName ( + person1.getID (), "Mary", "Jones") + self.assertEqual (transaction1.execute (system), None) + revisedPerson = personTransactions.GetPersonByID (person1.getID ()).execute (system) + self.assertEqual (revisedPerson.getFirstName (), "Mary") + self.assertEqual (revisedPerson.getLastName (), "Jones") + + if __name__ == '__main__': unittest.main() |