You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
namespace ConsoleTests
|
|
|
|
|
|
|
|
module PropertyTests =
|
|
|
|
|
|
|
|
open FsCheck
|
|
|
|
open FsCheck.Xunit
|
|
|
|
open Validation
|
|
|
|
open System
|
|
|
|
open SmoulderingBeachBall.Domain.DomainTypes
|
|
|
|
open System.Drawing
|
|
|
|
|
|
|
|
[<Property>]
|
|
|
|
let ``buildDefaultSpec creates intended type`` () =
|
|
|
|
let width = Random().Next()
|
|
|
|
let height = Random().Next()
|
|
|
|
let oSpec =
|
|
|
|
{ colour = Brushes.Black
|
|
|
|
overlayType = Full }
|
|
|
|
let defaultSpec =
|
|
|
|
{ width = width
|
|
|
|
height = height
|
|
|
|
colour = Brushes.AntiqueWhite
|
|
|
|
filePath = getDesktopPath
|
|
|
|
overlay = Some oSpec
|
|
|
|
}
|
|
|
|
let spec = buildDefaultSpec width height
|
|
|
|
defaultSpec = spec
|
|
|
|
|
|
|
|
Check.Quick (``buildDefaultSpec creates intended type`` ())
|
|
|
|
|
|
|
|
module UnitTests =
|
|
|
|
|
|
|
|
open Xunit
|
|
|
|
open Validation
|
|
|
|
open System
|
|
|
|
|
|
|
|
[<Fact>]
|
|
|
|
let ``Colour map is not empty`` () =
|
|
|
|
Assert.NotEmpty colourList
|
|
|
|
|
|
|
|
[<Fact>]
|
|
|
|
let ``getDesktopPath returns desktop path`` () =
|
|
|
|
let expectedPath =
|
|
|
|
Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
|
|
|
|
Assert.Equal (expectedPath, getDesktopPath)
|