|
|
|
@ -46,6 +46,8 @@
|
|
|
|
|
Intended for horizontal and vertical line tests. *) |
|
|
|
|
let newNum () = rand.Next(1, 1000) |
|
|
|
|
|
|
|
|
|
let newPenWidth () = rand.Next (1, 10) |
|
|
|
|
|
|
|
|
|
let newRGBANum () = rand.Next (255) |
|
|
|
|
|
|
|
|
|
let imagesInLoadingTestArea = |
|
|
|
@ -92,7 +94,7 @@
|
|
|
|
|
open System |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
|
let ``Can apply grid to image and save it`` () = |
|
|
|
|
let ``Can apply grid to image and save it using BrushSpec`` () = |
|
|
|
|
(* You should end up with one image left over in SavingTestArea. |
|
|
|
|
Comment out the "reset" function to see all the images produced, |
|
|
|
|
by this test. This will mean you will need to manually delete the |
|
|
|
@ -104,13 +106,36 @@
|
|
|
|
|
{ originalPath = oPath |
|
|
|
|
savePath = sPath |
|
|
|
|
colour = randomBrush () :?> Brush |
|
|
|
|
penWidth = float32 1 |
|
|
|
|
penWidth = float32 (newPenWidth()) |
|
|
|
|
rows = 10 |
|
|
|
|
columns = 10 } |
|
|
|
|
applyBrushSpecGridAsync spec |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
(File.Exists sPath) = true |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
|
let ``Can apply grid to image and save it using RGBASpec`` () = |
|
|
|
|
(* You should end up with one image left over in SavingTestArea. |
|
|
|
|
Comment out the "reset" function to see all the images produced, |
|
|
|
|
by this test. This will mean you will need to manually delete the |
|
|
|
|
images yourself if you do. *) |
|
|
|
|
resetSavingTestArea () |
|
|
|
|
let oPath = generateLoadPath () |
|
|
|
|
let sPath = generateSavePath oPath |
|
|
|
|
let (spec: RGBASpec) = |
|
|
|
|
{ originalPath = oPath |
|
|
|
|
savePath = sPath |
|
|
|
|
alpha = float (newRGBANum ()) |
|
|
|
|
red = float (newRGBANum ()) |
|
|
|
|
green = float (newRGBANum ()) |
|
|
|
|
blue = float (newRGBANum ()) |
|
|
|
|
penWidth = float32 (newPenWidth()) |
|
|
|
|
rows = 10 |
|
|
|
|
columns = 10 } |
|
|
|
|
applyRGBAGridAsync spec |
|
|
|
|
|> Async.RunSynchronously |
|
|
|
|
(File.Exists sPath) = true |
|
|
|
|
|
|
|
|
|
[<Property>] |
|
|
|
|
let ``SolidBrush colour matches the individual RGBA values`` () = |
|
|
|
|
let a = newRGBANum () |
|
|
|
|