This repository has been archived by the owner on Oct 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First part for Indexes (+ other Issues) (#108)
* id included * Diff hands (#4) * backend allows different hands * single-argument ini-configs * Mod cards (#5) * rules can play add-power cards * testing api * Fe limit (#3) * api passes limit * cards retrieved from rows * single-argument ini-config * useless spaces * new test * ups! * use mapv
- Loading branch information
Showing
9 changed files
with
114 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
(ns api.effects-test | ||
(:require [expectations.clojure.test :refer :all] | ||
[clojure.test :as ctest] | ||
[mocking :as mocking] | ||
[api.base :as api])) | ||
|
||
(ctest/use-fixtures :each mocking/mock-persistence) | ||
|
||
(defexpect playing-effects | ||
; Can play cards with effects and they act as expected | ||
(expect | ||
-100 | ||
(let [game (api/create-game {:hands [[{:power 0} {:power 100}] | ||
[{:power 1} {:power 10 :add-power -100}]]}) | ||
game-id (:game-id game) | ||
player-id (:player-id game) | ||
opponent-id (:player-id (api/add-player game-id))] | ||
(api/play-card-as-player game-id player-id 0 0) | ||
(api/play-card-as-player game-id opponent-id 0 1) | ||
(api/play-card-as-player game-id player-id 0 1) | ||
(api/play-card-as-player game-id opponent-id 0 1 [:rows 0 :cards 0]) | ||
(get-in (api/get-game game-id player-id) | ||
[:rows 0 :cards 0 :power])))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters