From 4bccd6bb028915542c4e8aa6d310cec7b5d7c899 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Mon, 1 Oct 2018 16:54:19 +0100 Subject: [PATCH] add unit tests for determining horizontal and vertical lines in lib. --- TestCentre/LibraryTests.fs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/TestCentre/LibraryTests.fs b/TestCentre/LibraryTests.fs index 335dbc2..34dbfd6 100644 --- a/TestCentre/LibraryTests.fs +++ b/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 \ No newline at end of file + Assert.True imagesAreThere + + [] + 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(fun () -> result() |> ignore) + + [] + 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(fun () -> result() |> ignore) \ No newline at end of file