 (in-ns 'test.core)
+
+(deftest daily-casts
+  "Play and tick through all turns of daily casts"
+  (do-game
+    (new-game (default-corp) (default-runner [(qty "Daily Casts" 3)]))
+    (take-credits state :corp)
+    (play-from-hand state :runner "Daily Casts")
+    (let [dc (get-in @state [:runner :rig :resource 0])]
+      ;Number of credits
+      (is (= 8 (get-in dc [:counter])))
+      (is (= 2 (get-in @state [:runner :credit])))
+      ;End turn
+      (take-credits state :runner)
+      (take-credits state :corp)
+      (is (= 6 (get-in (refresh dc) [:counter])))
+      (is (= 7 (get-in @state [:runner :credit])))
+      (take-credits state :runner)
+      (take-credits state :corp)
+      (is (= 4 (get-in (refresh dc) [:counter])))
+      (is (= 13 (get-in @state [:runner :credit])))
+      (take-credits state :runner)
+      (take-credits state :corp)
+      (is (= 2 (get-in (refresh dc) [:counter])))
+      (is (= 19 (get-in @state [:runner :credit])))
+      (take-credits state :runner)
+      (take-credits state :corp)
+      (is (nil? (get-in @state [:runner :rig :resource 0]))))))
+
+(deftest ddos
+  "Prevent rezzing of outermost ice for the rest of the turn"
+  (do-game
+    (new-game (default-corp [(qty "Ice Wall" 3)]) (default-runner [(qty "DDoS" 1)]))
+    (play-from-hand state :corp "Ice Wall" "HQ")
+    (play-from-hand state :corp "Ice Wall" "HQ")
+    (take-credits state :corp)
+    (play-from-hand state :runner "DDoS")
+    (let [ddos (get-in @state [:runner :rig :resource 0])
+          iwall (get-in @state [:corp :servers :hq :ices 0])]
+      (card-ability state :runner ddos 0)
+      (is (= (:title ddos) (get-in @state [:runner :discard 0 :title]) ))
+      (core/click-run state :runner {:server "HQ"})
+      (core/rez state :corp iwall)
+      (is (not (get-in (refresh iwall) [:rezzed])))
+      (core/end-run state :runner)
+      (core/click-run state :runner {:server "HQ"})
+      (core/rez state :corp iwall)
+      (is (not (get-in (refresh iwall) [:rezzed])))
+      (core/end-run state :runner)
+      (take-credits state :runner)
+      (take-credits state :corp)
+      (core/click-run state :runner {:server "HQ"})
+      (core/rez state :corp iwall)
+      (is (get-in (refresh iwall) [:rezzed])))))
 
 (deftest film-critic-fetal-ai
   "Film Critic - Fetal AI interaction"

      (core/jack-out state :runner nil)
      (is (= 1 (:current-strength (refresh iwall))) "Ice Wall strength at 1 after encounter"))))

(deftest kati-jones
  "Kati Jones - Click to store and take"
  (do-game

      (prompt-select :runner hive)
      (is (= 2 (get (refresh hive) :counter 0)) "Hivemind gained 1 counter")
      (is (= 0 (get (refresh vbg) :counter 0)) "Virus Breeding Ground lost 1 counter"))))
