forked from fsprojects/FsUnit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathequivalentTests.fs
More file actions
40 lines (30 loc) · 1.24 KB
/
Copy pathequivalentTests.fs
File metadata and controls
40 lines (30 loc) · 1.24 KB
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
namespace FsUnit.Test
open System
open Xunit
open FsUnit.Xunit
module EquivalentTests =
[<Fact>]
let ``two lists with same elements in different order are equivalent``() =
[ 1; 2; 3 ] |> should equivalent [ 3; 2; 1 ]
[<Fact>]
let ``two lists with different elements are not equivalent``() =
[ 1; 2; 3 ] |> should not' (equivalent [ 4; 5; 6 ])
[<Fact>]
let ``two lists with different lengths are not equivalent``() =
[ 1; 2; 3 ] |> should not' (equivalent [ 1; 2 ])
[<Fact>]
let ``two arrays with same elements in different order are equivalent``() =
[| 1; 2; 3 |] |> should equivalent [| 3; 2; 1 |]
[<Fact>]
let ``two arrays with different elements are not equivalent``() =
[| 1; 2; 3 |] |> should not' (equivalent [| 4; 5; 6 |])
[<Fact>]
let ``empty collections are equivalent``() =
[] |> should equivalent []
[||] |> should equivalent [||]
[<Fact>]
let ``collections with same elements and duplicates are not equivalent if counts differ``() =
[ 1; 1; 2 ] |> should not' (equivalent [ 1; 2; 2 ])
[<Fact>]
let ``collections with same elements and same counts are equivalent``() =
[ 1; 1; 2 ] |> should equivalent [ 2; 1; 1 ]