diff --git a/DeathSocket/ImageServices.fs b/DeathSocket/ImageServices.fs index 521e5ce..05e0d3c 100644 --- a/DeathSocket/ImageServices.fs +++ b/DeathSocket/ImageServices.fs @@ -35,7 +35,6 @@ // for line in verticalLines do graphics.DrawLines (pen, line) // clone.Save (spec.savePath) - // not tested but same as Draw Grid -- this is its replacement let drawBrushSpecGrid (spec: BrushSpec) = // The temp. file is used as a way to convert images with indexed pixels. use original = Bitmap.FromFile spec.originalPath diff --git a/TestCentre/LibraryTests.fs b/TestCentre/LibraryTests.fs index 5075547..d2638ef 100644 --- a/TestCentre/LibraryTests.fs +++ b/TestCentre/LibraryTests.fs @@ -113,6 +113,7 @@ open Xunit open DeathSocket open System + open System.IO (* 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. @@ -125,6 +126,16 @@ let imagesAreThere = if length < 100 then false else true Assert.True imagesAreThere + (* This test is a precaution. 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 + (at the root). You can, also, see script.fs (in Test Centre) for + creating this folder via code. (See "LoadingTestArea contains..." note + for extra context. *) + [] + let ``SavingTestArea folder can be found`` () = + Assert.True (Directory.Exists saveLocation) + [] let ``Divide By Zero Exception is thrown when 0 rows is used when determining horizontal lines`` () = let result () = GridPainter.determineHorizontalLines 100 100 0 diff --git a/TestCentre/Script.fsx b/TestCentre/Script.fsx index e053c75..58283d6 100644 --- a/TestCentre/Script.fsx +++ b/TestCentre/Script.fsx @@ -14,7 +14,7 @@ let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea" let saveLocation = __SOURCE_DIRECTORY__ + "/SavingTestArea" let random = Random() -(*Resetting the Testing Area Folders Scripts +(* Resetting the Testing Area Folders Scripts =============================================================================== The following scripts are for when you need to "manually" clear out the LoadingTestArea and SavingTestArea folders. If you do not want to open up the @@ -93,4 +93,22 @@ let populateLoadingTestArea () = // You should only need this once. // Make sure you have passed the above into F# Interactive. -populateLoadingTestArea () \ No newline at end of file +populateLoadingTestArea () + +(* Creating the Saving Test Area Script +============================================================================== +This bit of code is for creating the SavingTestArea folder which Test Centre +will use when it runs its tests. You will normally only need to run this code +when you have just cloned this repository or you accidently deleted said +fodler. In other words, you should only need to use it once. *) + +let createSavingTestArea () = + match Directory.Exists saveLocation with + | false -> + Directory.CreateDirectory saveLocation |> ignore + printfn "SavingTestArea created." + | _ -> printfn "SavingTestArea already exists." + +(* Before calling this function, make sure the test checking this folder exists +is failing first. *) +createSavingTestArea () \ No newline at end of file