From 5215abf5f751fcd4f480def19e0711753bec3cd4 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Mon, 3 Dec 2018 23:48:07 +0000 Subject: [PATCH] add skia based property tests for validation functions in CLI. --- TestCentre/ConsoleTests.fs | 39 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/TestCentre/ConsoleTests.fs b/TestCentre/ConsoleTests.fs index ac4294d..78a46cb 100644 --- a/TestCentre/ConsoleTests.fs +++ b/TestCentre/ConsoleTests.fs @@ -88,6 +88,45 @@ buildSpec loadPath randRows randCols pWidth colourString savePath intendedSpec = spec + [] + let ``Can build a SkiaSpec as intended`` () = + let colourString = randomColourString () + let colour = parseSkiaColour colourString + let pWidth = float32 (Random().Next()) + let randRows = (Random().Next()) + let randCols = (Random().Next()) + let intendedSpec = + { originalPath = loadPath + savePath = savePath + skColour = colour + penWidth = pWidth + rows =randRows + columns = randCols } + let spec = + buildSkiaSpec loadPath randRows randCols pWidth colourString savePath + intendedSpec = spec + + [] + let ``Can build a SkiaRGBSpec as intended`` () = + let r = (Random().Next()) + let g = (Random().Next()) + let b = (Random().Next()) + let pWidth = float32 (Random().Next()) + let randRows = (Random().Next()) + let randCols = (Random().Next()) + let intendedSpec = + { originalPath = loadPath + savePath = savePath + red = (float32 r) + green = (float32 g) + blue = (float32 b) + penWidth = pWidth + rows =randRows + columns = randCols } + let spec = + buildSkiaRGBSpec loadPath randRows randCols pWidth r g b savePath + intendedSpec = spec + module UnitTests = open System.IO