|
|
@ -8,6 +8,39 @@ open System.Reflection |
|
|
|
open SmoulderingBeachBall.Domain |
|
|
|
open SmoulderingBeachBall.Domain |
|
|
|
open SmoulderingBeachBall.Services |
|
|
|
open SmoulderingBeachBall.Services |
|
|
|
open System.Threading |
|
|
|
open System.Threading |
|
|
|
|
|
|
|
open System.IO |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea" |
|
|
|
|
|
|
|
let saveLocation = __SOURCE_DIRECTORY__ + "/SavingTestArea" |
|
|
|
|
|
|
|
let random = Random() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(*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 |
|
|
|
|
|
|
|
folder in Explorer and delete the files that way, just run the scripts in this |
|
|
|
|
|
|
|
section. If you reset the LoadingTestArea, you will need to repopulate it using |
|
|
|
|
|
|
|
the "Populating LoadingTestArea Folder Scripts" below. *) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let resetSavingTestArea () = |
|
|
|
|
|
|
|
let files = Directory.GetFileSystemEntries(saveLocation, "*.png") |
|
|
|
|
|
|
|
match files.Length with |
|
|
|
|
|
|
|
| 0 -> () |
|
|
|
|
|
|
|
| _ -> |
|
|
|
|
|
|
|
files |
|
|
|
|
|
|
|
|> Array.iter (fun f -> File.Delete(f)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let resetLoadingTestArea () = |
|
|
|
|
|
|
|
let files = Directory.GetFileSystemEntries(loadLocation, "*.png") |
|
|
|
|
|
|
|
match files.Length with |
|
|
|
|
|
|
|
| 0 -> () |
|
|
|
|
|
|
|
| _ -> |
|
|
|
|
|
|
|
files |
|
|
|
|
|
|
|
|> Array.iter (fun f -> File.Delete(f)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Run these when the above functions have been added to F# interactive. |
|
|
|
|
|
|
|
resetSavingTestArea () |
|
|
|
|
|
|
|
resetLoadingTestArea () |
|
|
|
|
|
|
|
|
|
|
|
(* Populating LoadingTestArea Folder Scripts |
|
|
|
(* Populating LoadingTestArea Folder Scripts |
|
|
|
=============================================================================== |
|
|
|
=============================================================================== |
|
|
@ -16,10 +49,6 @@ You can then use these images in LibraryTests.fs -- Property Tests. |
|
|
|
The tests consists of loading images from LoadingTestArea, transforming them |
|
|
|
The tests consists of loading images from LoadingTestArea, transforming them |
|
|
|
and saving them in SavingTestArea. *) |
|
|
|
and saving them in SavingTestArea. *) |
|
|
|
|
|
|
|
|
|
|
|
let saveLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let random = Random() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let allColours = |
|
|
|
let allColours = |
|
|
|
let properties = |
|
|
|
let properties = |
|
|
|
typeof<Brushes>.GetProperties(BindingFlags.Public ||| BindingFlags.Static) |
|
|
|
typeof<Brushes>.GetProperties(BindingFlags.Public ||| BindingFlags.Static) |
|
|
@ -42,7 +71,7 @@ let populateSpec sizes = |
|
|
|
{ width = randomSize (sizes) |
|
|
|
{ width = randomSize (sizes) |
|
|
|
height = randomSize (sizes) |
|
|
|
height = randomSize (sizes) |
|
|
|
colour = (randomBrush ()) :?> Brush |
|
|
|
colour = (randomBrush ()) :?> Brush |
|
|
|
filePath = saveLocation |
|
|
|
filePath = loadLocation |
|
|
|
overlay = None } |
|
|
|
overlay = None } |
|
|
|
|
|
|
|
|
|
|
|
let generateSpecs amount = |
|
|
|
let generateSpecs amount = |
|
|
|