summaryrefslogtreecommitdiffstats
path: root/bank-eiffel/tests/test_person.e
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2011-05-23 20:37:54 +0200
committermanuel <manuel@mausz.at>2011-05-23 20:37:54 +0200
commit1daf62f05c19e6f96d16d3688055dfd20d89d2b8 (patch)
tree4e79c5894ee9f5c1d350565e6aae2f9dbd31deaa /bank-eiffel/tests/test_person.e
parente03195a9325d2671208efc45f4a4d083664eafe2 (diff)
downloadfoop-1daf62f05c19e6f96d16d3688055dfd20d89d2b8.tar.gz
foop-1daf62f05c19e6f96d16d3688055dfd20d89d2b8.tar.bz2
foop-1daf62f05c19e6f96d16d3688055dfd20d89d2b8.zip
- add tests
- remove notes - fix minamount for subaccounts
Diffstat (limited to 'bank-eiffel/tests/test_person.e')
-rw-r--r--bank-eiffel/tests/test_person.e37
1 files changed, 9 insertions, 28 deletions
diff --git a/bank-eiffel/tests/test_person.e b/bank-eiffel/tests/test_person.e
index 67aea34..f42767c 100644
--- a/bank-eiffel/tests/test_person.e
+++ b/bank-eiffel/tests/test_person.e
@@ -1,12 +1,3 @@
1note
2 description: "[
3 Eiffel tests that can be executed by testing tool.
4 ]"
5 author: "EiffelStudio test wizard"
6 date: "$Date$"
7 revision: "$Revision$"
8 testing: "type/manual"
9
10class 1class
11 TEST_PERSON 2 TEST_PERSON
12 3
@@ -14,10 +5,11 @@ inherit
14 EQA_TEST_SET 5 EQA_TEST_SET
15 6
16feature -- Test routines 7feature -- Test routines
17
18 CREATE_EDIT_PERSON 8 CREATE_EDIT_PERSON
19 local 9 local
20 person: PERSON 10 person: PERSON
11 student: STUDENT
12 retiree: RETIREE
21 do 13 do
22 create person.make("SOME_SURNAME_1", "SOME_FIRSTNAME_1") 14 create person.make("SOME_SURNAME_1", "SOME_FIRSTNAME_1")
23 assert("CREATE_EDIT_PERSON_FIRSTNAME_1", person.firstname.is_equal("SOME_FIRSTNAME_1")) 15 assert("CREATE_EDIT_PERSON_FIRSTNAME_1", person.firstname.is_equal("SOME_FIRSTNAME_1"))
@@ -27,31 +19,28 @@ feature -- Test routines
27 assert("CREATE_EDIT_PERSON_FIRSTNAME_2", person.firstname.is_equal("SOME_FIRSTNAME_2")) 19 assert("CREATE_EDIT_PERSON_FIRSTNAME_2", person.firstname.is_equal("SOME_FIRSTNAME_2"))
28 person.surname := "SOME_SURNAME_2" 20 person.surname := "SOME_SURNAME_2"
29 assert("CREATE_EDIT_PERSON_SURNAME_2", person.surname.is_equal("SOME_SURNAME_2")) 21 assert("CREATE_EDIT_PERSON_SURNAME_2", person.surname.is_equal("SOME_SURNAME_2"))
22
23 create student.make ("STUDENT_SURNAME", "STUDENT_FIRSTNAME")
24 assert("CREATE_EDIT_PERSON_STUDENT", attached {PERSON} student)
25 create retiree.make ("RETIREE_SURNAME", "RETIREE_FIRSTNAME")
26 assert("CREATE_EDIT_PERSON_RETIREE", attached {PERSON} student)
30 end 27 end
31 28
32 CREATE_EDIT_PERSON_EMPTY_SURNAME 29 CREATE_EDIT_PERSON_EMPTY_SURNAME
33 local 30 local
34 person: PERSON 31 person: PERSON
35 retry_count: INTEGER 32 retry_count: INTEGER
36 doretry: BOOLEAN
37 do 33 do
38 if retry_count = 0 then 34 if retry_count = 0 then
39 doretry := True
40 create person.make("", "SOME_FIRSTNAME") 35 create person.make("", "SOME_FIRSTNAME")
41 doretry := False
42 assert("CREATE_EDIT_PERSON_EMPTY_SURNAME_1", False) 36 assert("CREATE_EDIT_PERSON_EMPTY_SURNAME_1", False)
43 elseif retry_count = 1 then 37 elseif retry_count = 1 then
44 doretry := False
45 create person.make("SOME_SURNAME", "SOME_FIRSTNAME") 38 create person.make("SOME_SURNAME", "SOME_FIRSTNAME")
46 doretry := True
47 person.surname := "" 39 person.surname := ""
48 doretry := False
49 assert("CREATE_EDIT_PERSON_EMPTY_SURNAME_3", False) 40 assert("CREATE_EDIT_PERSON_EMPTY_SURNAME_3", False)
50 else
51 doretry := False
52 end 41 end
53 rescue 42 rescue
54 if doretry then 43 if not (create {EXCEPTIONS}).is_developer_exception then
55 retry_count := retry_count + 1 44 retry_count := retry_count + 1
56 retry 45 retry
57 end 46 end
@@ -61,25 +50,17 @@ feature -- Test routines
61 local 50 local
62 person: PERSON 51 person: PERSON
63 retry_count: INTEGER 52 retry_count: INTEGER
64 doretry: BOOLEAN
65 do 53 do
66 if retry_count = 0 then 54 if retry_count = 0 then
67 doretry := True
68 create person.make("SOME_SURNAME", "") 55 create person.make("SOME_SURNAME", "")
69 doretry := False
70 assert("CREATE_EDIT_PERSON_EMPTY_FIRSTNAME_1", False) 56 assert("CREATE_EDIT_PERSON_EMPTY_FIRSTNAME_1", False)
71 elseif retry_count = 1 then 57 elseif retry_count = 1 then
72 doretry := False
73 create person.make("SOME_SURNAME", "SOME_FIRSTNAME") 58 create person.make("SOME_SURNAME", "SOME_FIRSTNAME")
74 doretry := True
75 person.firstname := "" 59 person.firstname := ""
76 doretry := False
77 assert("CREATE_EDIT_PERSON_EMPTY_FIRSTNAME_3", False) 60 assert("CREATE_EDIT_PERSON_EMPTY_FIRSTNAME_3", False)
78 else
79 doretry := False
80 end 61 end
81 rescue 62 rescue
82 if doretry then 63 if not (create {EXCEPTIONS}).is_developer_exception then
83 retry_count := retry_count + 1 64 retry_count := retry_count + 1
84 retry 65 retry
85 end 66 end