Browse Source

add unit tests for determining horizontal and vertical lines in lib.

master
Craig Oates 6 years ago
parent
commit
4bccd6bb02
  1. 14
      TestCentre/LibraryTests.fs

14
TestCentre/LibraryTests.fs

@ -93,6 +93,8 @@
open TestingHelpers
open Xunit
open DeathSocket
open System
(* This test is a precaution (a test for the tests if you will...).
It is here to make sure the property test has what it needs to run.
@ -103,4 +105,14 @@
let ``LoadingTestArea contains at least 100 test images`` () =
let length = imagesInLoadingTestArea.Length
let imagesAreThere = if length < 100 then false else true
Assert.True imagesAreThere
Assert.True imagesAreThere
[<Fact>]
let ``Divide By Zero Exception is thrown when 0 rows is used when determining horizontal lines`` () =
let result () = GridPainter.determineHorizontalLines 100 100 0
Assert.Throws<DivideByZeroException>(fun () -> result() |> ignore)
[<Fact>]
let ``Divide By Zero Exception is thrown when 0 columns is used when determining vertical lines`` () =
let result () = GridPainter.determineVerticalLines 100 100 0
Assert.Throws<DivideByZeroException>(fun () -> result() |> ignore)
Loading…
Cancel
Save