Sha256: 482beae1d9de896948e986bd2813e6b9b0cd3957fd8b1a971b1e8d718777a952

Contents?: true

Size: 1.6 KB

Versions: 396

Compression:

Stored size: 1.6 KB

Contents

(ns grade-school-test
  (:require [clojure.test :refer [deftest is]]
            grade-school))

(def db {})

(deftest add-student
  (is (= {2 ["Aimee"]} (grade-school/add db "Aimee" 2))))

(deftest add-more-students-in-same-class
  (is (= {2 ["James", "Blair", "Paul"]}
         (-> db
             (grade-school/add "James" 2)
             (grade-school/add "Blair" 2)
             (grade-school/add "Paul" 2)))))

(deftest add-students-to-different-grades
  (is (= {3 ["Chelsea"] 7 ["Logan"]}
         (-> db
             (grade-school/add "Chelsea" 3)
             (grade-school/add "Logan" 7)))))

(deftest get-students-in-a-grade
  (is (= ["Franklin", "Bradley"]
         (-> db
             (grade-school/add "Franklin" 5)
             (grade-school/add "Bradley" 5)
             (grade-school/add "Jeff" 1)
             (grade-school/grade 5)))))

(deftest get-students-in-a-non-existant-grade
  (is (= [] (grade-school/grade db 1))))

(deftest sorted-grade-school
  (is (= (sorted-map 3 ["Kyle"]
                     4 ["Christopher" "Jennifer"]
                     6 ["Kareem"] )
         (-> db
             (grade-school/add "Jennifer" 4)
             (grade-school/add "Kareem" 6)
             (grade-school/add "Christopher" 4)
             (grade-school/add "Kyle" 3)
             (grade-school/sorted)))))

(deftest sorted-grade_school-keys-sorted
  (is (= [3 4 6]
         (-> db
             (grade-school/add "Jennifer" 4)
             (grade-school/add "Kareem" 6)
             (grade-school/add "Christopher" 4)
             (grade-school/add "Kyle" 3)
             (grade-school/sorted)
             (keys)))))

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.179 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.178 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.177 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.176 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.175 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.174 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.173 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.172 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.171 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.170 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.169 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.167 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.166 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.165 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.164 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.163 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.162 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.161 tracks/clojure/exercises/grade-school/test/grade_school_test.clj
trackler-2.2.1.160 tracks/clojure/exercises/grade-school/test/grade_school_test.clj