diff options
| author | El-BG-1970 <elouangros@hotmail.com> | 2022-07-31 18:15:19 +0200 |
|---|---|---|
| committer | El-BG-1970 <elouangros@hotmail.com> | 2022-07-31 18:15:19 +0200 |
| commit | 374cada07cb663cae76d0d1896cfad5172752fc3 (patch) | |
| tree | ce3ccdbd02fb9bdd7ec36a2e93c0a5e9455a9de3 /tests/test.lisp | |
| parent | 3dc8dc250a5cd4089f43a4ff2ac9e9593fa93203 (diff) | |
| download | transacc-374cada07cb663cae76d0d1896cfad5172752fc3.tar.gz | |
added repay-debt to player
Diffstat (limited to 'tests/test.lisp')
| -rw-r--r-- | tests/test.lisp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/test.lisp b/tests/test.lisp index a98e0db..4961962 100644 --- a/tests/test.lisp +++ b/tests/test.lisp @@ -90,8 +90,6 @@ (commodities:price (car (inventory::find-item i "apple"))))))) -;; creating inventory adding - ;;; Player tests (def-suite* player-suite @@ -111,16 +109,22 @@ (is (= (player:cash p2) 555)) (is (= (player:debt p2) 8976)))) +(test repay-debt + (let ((p (player::init-player "Joze")) + (p2 (player::init-player "Mehmout"))) + (is (player::repay-debt p 1000)) + (is (player::repay-debt p 1000)) + (is (not (player::repay-debt p2 3000))))) + (test buy-item (let ((p (player:init-player "Joze")) (c (commodities:new-commodity "apple" 5)) - (c2 (commodities:new-commodity) "apple" 11) + (c2 (commodities:new-commodity "apple" 11)) (truck (commodities:new-commodity "truck" 100000))) (is (player:buy-item p c 10)) - (is (not (player:buy-item p kar 1))) + (is (not (player:buy-item p truck 1))) (is (= 10 (inventory:filled (player::stock p)))) (is (player:buy-item p c2 10)) (is (= 20 - (inventory:filled (player::stock p)))) - )) + (inventory:filled (player::stock p)))))) |
