forked from haraldsteinlechner/FsFhtw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTests.fs
43 lines (32 loc) · 1.18 KB
/
Tests.fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
module FsFhtw.Tests
open Xunit
open FsCheck
[<Fact>]
let ``That the laws of reality still apply`` () =
Assert.True(1 = 1)
//[<Fact>]
//let ``That incrementing twice on an initialized counter yields 2`` () =
// let initialState = Domain.init ()
// let actual =
// Domain.update Domain.Increment initialState
// |> Domain.update Domain.Increment
// let expected = 2
// Assert.Equal(expected, actual)
//// not the best helper function for property based tests
//// because itselve has testable behavior
//let getInverse (message : Domain.Message) =
// match message with
// | Domain.Increment -> Domain.Decrement
// | Domain.Decrement -> Domain.Increment
// | Domain.IncrementBy x -> Domain.DecrementBy x
// | Domain.DecrementBy x -> Domain.IncrementBy x
//[<Fact>]
//let ``That applying the inverse of counter event yields the initial state`` () =
// let prop (message : Domain.Message) =
// let initialState = Domain.init ()
// let actual =
// initialState
// |> Domain.update message
// |> Domain.update (getInverse message)
// actual = initialState
// Check.QuickThrowOnFailure prop