From 703de8b8cd2d464cfbb62082d822d61558b87ed6 Mon Sep 17 00:00:00 2001 From: "OPTIMUS-PRIME\\craig" Date: Sat, 15 Sep 2018 16:44:40 +0100 Subject: [PATCH] leave comments in testing files, noting the script.fs file and role. --- TestCentre/ConsoleTests.fs | 9 +++++++++ TestCentre/LibraryTests.fs | 27 +++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/TestCentre/ConsoleTests.fs b/TestCentre/ConsoleTests.fs index 95cd185..6cb3334 100644 --- a/TestCentre/ConsoleTests.fs +++ b/TestCentre/ConsoleTests.fs @@ -1,5 +1,14 @@ namespace ConsoleTests + (* Initial Setup -- Populating the Test Folders. + =========================================================================== + If you have just cloned this repository or have not run any of the tests + before, please head over to script.fs (in Test Centre) and populate the + LoadingTestArea and SavingTestArea folders. More information will be + provided there about what the scripts do. It is worth pointing out here, + though, the .gitignore file ignores any .png files in them. + This is why you must populate them before running any tests. *) + module TestingHelpers = (* When you are writing tests, please keep all helper functions in this module. diff --git a/TestCentre/LibraryTests.fs b/TestCentre/LibraryTests.fs index 6b7e67c..b0c0ed2 100644 --- a/TestCentre/LibraryTests.fs +++ b/TestCentre/LibraryTests.fs @@ -1,7 +1,20 @@ namespace LibraryTests + (* Initial Setup -- Populating the Test Folders. + =========================================================================== + If you have just cloned this repository or have not run any of the tests + before, please head over to script.fs (in Test Centre) and populate the + LoadingTestArea and SavingTestArea folders. More information will be + provided there about what the scripts do. It is worth pointing out here, + though, the .gitignore file ignores any .png files in them. + This is why you must populate them before running any tests. *) + module TestingHelpers = + (* When you are writing tests, please keep all helper functions in this + module. If this module grows to a point where it hinders the actual + testing modules, consider moving it then. *) + open System open System.Drawing open System.Reflection @@ -20,7 +33,8 @@ let item = allColours.[Random().Next(allColours.Length)] item.GetValue(null, null) - let imagesInLoadingTestArea = Directory.GetFileSystemEntries (loadLocation, "*.png") + let imagesInLoadingTestArea = + Directory.GetFileSystemEntries (loadLocation, "*.png") let generateLoadPath () = let rand = Random () @@ -31,8 +45,6 @@ let fileName = Path.GetFileName originalFilePath saveLocation + "/" + fileName - let fileSaved path = File.Exists path - module PropertyTests = open FsCheck.Xunit @@ -50,7 +62,7 @@ { originalPath = oPath savePath = sPath colour = randomBrush () :?> Brush - penWidth = float32 0.1 + penWidth = float32 1 rows = 10 columns = 10 } applyGrid spec @@ -59,11 +71,14 @@ module UnitTests = - open System.IO open TestingHelpers open Xunit - // This test is just a check to make sure the property tests have what they need to run. + (* 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. + If the property test fails, here is a good place to start. + See script.fs (in Test Centre) for information on populating the + LoadingTestArea folder. *) [] let ``LoadingTestArea contains at least 100 test images`` () = let length = imagesInLoadingTestArea.Length