From 9aed4ba6093ee994f1fe7d595591f5c2471f74dc Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Mon, 31 Dec 2018 16:40:26 +0000 Subject: [PATCH] add scaling pen thickness tests. --- TestCentre/LibraryTests.fs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/TestCentre/LibraryTests.fs b/TestCentre/LibraryTests.fs index f158f0f..17abe0c 100644 --- a/TestCentre/LibraryTests.fs +++ b/TestCentre/LibraryTests.fs @@ -421,6 +421,24 @@ let imagesAreThere = if length < 100 then false else true Assert.True imagesAreThere + [] + let ``Pen thickness scales down to match preview image dimensions`` () = + let result () = + GridPainter.scaleLineThickness (100, 100) (200, 200) 10.0 + Assert.Equal (5.0, (result ())) + + [] + let ``Pen thickness scales up to match preview image dimensions`` () = + let result () = + GridPainter.scaleLineThickness (200, 200) (100, 100) 10.0 + Assert.Equal (20.0, (result ())) + + [] + let ``Pen thickness remains the same when preview image matches actual dimensions`` () = + let result () = + GridPainter.scaleLineThickness (100, 100) (100, 100) 10.0 + Assert.Equal (10.0, (result ())) + (* This test is a pre-test test. If the property tests fails, here is a good place to start. The easiest way to get this test to pass is to create a folder called "SavingTestArea" in this projects folder