Browse Source

add test for checking SKData with SkiaBuffer.

master
Craig Oates 5 years ago
parent
commit
591b46a188
  1. 16
      TestCentre/LibraryTests.fs

16
TestCentre/LibraryTests.fs

@ -34,6 +34,9 @@
let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea" let loadLocation = __SOURCE_DIRECTORY__ + "/LoadingTestArea"
let saveLocation = __SOURCE_DIRECTORY__ + "/SavingTestArea" let saveLocation = __SOURCE_DIRECTORY__ + "/SavingTestArea"
let fixedSkiaImagePath =
(loadLocation + "/RequiredInfo/Skia-599x336.png")
let allColours = let allColours =
let properties = let properties =
typeof<Brushes>.GetProperties typeof<Brushes>.GetProperties
@ -105,6 +108,7 @@
open DeathSocket.GridPainter open DeathSocket.GridPainter
open TestingHelpers open TestingHelpers
open FsCheck.Xunit open FsCheck.Xunit
open SkiaSharp
(* With regards to the "saving images" tests, you should end up with (* With regards to the "saving images" tests, you should end up with
one image left over in the SavingTestArea folder. Comment out the one image left over in the SavingTestArea folder. Comment out the
@ -219,6 +223,18 @@
let result = determineSKVerticalLines (newNum()) (newNum()) (newNum()) let result = determineSKVerticalLines (newNum()) (newNum()) (newNum())
result.Length > 0 result.Length > 0
[<Property>]
let ``Can create a populated SKData buffer when calling createSKDataAsync with SkiaBuffer`` () =
let result () =
SkiaBuffer ({ filePath = fixedSkiaImagePath
skColour = randomSKColour ()
penWidth = float32 (newPenWidth())
rows = newNum ()
columns = newNum () })
|> createSKDataAsync
|> Async.RunSynchronously
(result ()).IsEmpty = false
module UnitTests = module UnitTests =
open System open System

Loading…
Cancel
Save