Commits

Philipp Dörfler committed d503e33

Restricted daytimes to be positive

Comments (0)

Files changed (2)

src/test/scala/org/swiftsteel/model/playground/LightingSpec.scala

   "Lighting" should {
     "be different depending on daytime" in {
       "time"         | "expected" |>
-      Daytime(-0.1)  ! NIGHT      |
       Daytime(0d)    ! DAY        |
       Daytime(50d)   ! DAY        |
       Daytime(50.1d) ! NIGHT      |

src/test/scala/org/swiftsteel/model/time/DaytimeSpec.scala

     "leap correctly" in {
       Daytime(100.00001d).time must be closeTo(0.00001d +/- 0.00000000000001d)
     }
+    
+    "be positive" in {
+      Daytime(-0.1d) must throwAn[IllegalArgumentException]
+    }
   }
 }