-
Notifications
You must be signed in to change notification settings - Fork 1
/
complex_atm_example.clj
63 lines (55 loc) · 2.45 KB
/
complex_atm_example.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
(ns gp.problems.complex-atm
(:refer-clojure :exclude [test assert])
(:use easd))
(test charge?
[statement-printed money-withdrawn money-deposited non-member
premium-account checking-account savings-account security-flag]
("true when money was withdrawn"
(assert * 1 * * * * * *))
("true when a statement was printed but no money was deposited"
(assert 1 * 0 * * * * *)))
(test email?
[statement-printed money-withdrawn money-deposited non-member
premium-account checking-account savings-account security-flag]
("true when money was withdrawn but a statement was not printed"
(assert * 1 * * * * * *))
("true when money was deposited but a statement was not printed"
(assert 1 * 0 * * * * *)))
(test surcharge?
[statement-printed money-withdrawn money-deposited non-member
premium-account checking-account savings-account security-flag]
("true when money was withdrawn for a non-member without a premium account"
(assert * 1 * 1 0 * * *)))
(test reward-points?
[statement-printed money-withdrawn money-deposited non-member
premium-account]
("true when a premium account deposits money"
(assert * * 1 * 1 * * *)))
(test confirmation?
[statement-printed money-withdrawn money-deposited non-member
premium-account checking-account savings-account security-flag]
("true when money was withdrawn from a savings-account"
(assert * 1 * * * * 1 *)))
(test video-snapshot?
[statement-printed money-withdrawn money-deposited non-member
premium-account checking-account savings-account security-flag]
("true when money was withdrawn and the security flag is set"
(assert * 1 * * * * * 1))
("true when a statement was printed and the security flag is set"
(assert 1 * * * * * * 1)))
(test advertise-plans?
[statement-printed money-withdrawn money-deposited non-member
premium-account checking-account savings-account security-flag]
("true when a checking account deposits money but is not a premium account"
(assert * * 1 * 0 1 * *))
("true when a checking account withdraws money but is not a premium account"
(assert * 1 * * 0 1 * *)))
(test record-statistic?
[statement-printed money-withdrawn money-deposited non-member
premium-account checking-account savings-account security-flag]
("true when a non-member makes a transaction"
(assert * * * 1 * * * *))
("true when the security flag is set"
(assert * * * * * * * 1))
("true when a premium-account makes a transaction"
(assert * * * * 1 * * *)))