From cc2fdc041065d969f3c830a15a80ad8b93fdb162 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Mon, 3 Dec 2018 23:22:53 +0000 Subject: [PATCH] add unit tests for skia based validation functions in CLI. --- DeathSocketCLI/Validation.fs | 2 +- TestCentre/ConsoleTests.fs | 11 ++++++++++- TestCentre/TestCentre.fsproj | 5 +++++ TestCentre/packages.config | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/DeathSocketCLI/Validation.fs b/DeathSocketCLI/Validation.fs index 7b42a6a..ffef344 100644 --- a/DeathSocketCLI/Validation.fs +++ b/DeathSocketCLI/Validation.fs @@ -79,7 +79,7 @@ "red", SKColors.Red "white", SKColors.White "yellow", SKColors.Yellow ] - |> Map.ofList + |> Map.ofList let isSkiaColourValid (colour: string) = skiaColourList diff --git a/TestCentre/ConsoleTests.fs b/TestCentre/ConsoleTests.fs index 32f4d0c..ac4294d 100644 --- a/TestCentre/ConsoleTests.fs +++ b/TestCentre/ConsoleTests.fs @@ -110,4 +110,13 @@ [] let ``Exception thrown when invalid colour is used`` () = Assert.Throws - (fun () -> parseColour "not a valid colour" |> ignore) \ No newline at end of file + (fun () -> parseColour "not a valid colour" |> ignore) + + [] + let ``Skia colour list is not empty`` () = + Assert.False (skiaColourList.IsEmpty) + + [] + let ``Exception thrown when invalid skia-colour is used`` () = + Assert.Throws + (fun () -> parseSkiaColour "not a valid colour" |> ignore) diff --git a/TestCentre/TestCentre.fsproj b/TestCentre/TestCentre.fsproj index e949b4a..51259fd 100644 --- a/TestCentre/TestCentre.fsproj +++ b/TestCentre/TestCentre.fsproj @@ -62,6 +62,9 @@ ..\packages\FSharp.Core.4.5.4\lib\net45\FSharp.Core.dll + + ..\packages\SkiaSharp.1.60.3\lib\net45\SkiaSharp.dll + ..\packages\SmoulderingBeachBall.0.4.0-alpha1\lib\netstandard2.0\SmoulderingBeachBall.dll @@ -107,8 +110,10 @@ + +