Skip to content

Commit e59e43f

Browse files
authored
Merge pull request #240 from CaptnCodr/dependencies
Update dependencies.
2 parents ab9464b + c52729b commit e59e43f

File tree

10 files changed

+63
-68
lines changed

10 files changed

+63
-68
lines changed

paket.lock

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ RESTRICTION: || (== net6.0) (== netstandard2.0)
22
NUGET
33
remote: https://api.nuget.org/v3/index.json
44
FSharp.Core (5.0.2)
5-
Microsoft.CodeCoverage (17.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1))
6-
Microsoft.NET.Test.Sdk (17.6.2)
7-
Microsoft.CodeCoverage (>= 17.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1))
8-
Microsoft.TestPlatform.TestHost (>= 17.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
9-
Microsoft.NETCore.Platforms (7.0.2)
5+
Microsoft.CodeCoverage (17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1))
6+
Microsoft.NET.Test.Sdk (17.6.3)
7+
Microsoft.CodeCoverage (>= 17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= net462)) (&& (== netstandard2.0) (>= netcoreapp3.1))
8+
Microsoft.TestPlatform.TestHost (>= 17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
9+
Microsoft.NETCore.Platforms (7.0.3)
1010
Microsoft.NETCore.Targets (5.0)
11-
Microsoft.TestPlatform.ObjectModel (17.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
11+
Microsoft.TestPlatform.ObjectModel (17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
1212
NuGet.Frameworks (>= 6.5)
1313
System.Reflection.Metadata (>= 1.6)
14-
Microsoft.TestPlatform.TestHost (17.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
15-
Microsoft.TestPlatform.ObjectModel (>= 17.6.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
14+
Microsoft.TestPlatform.TestHost (17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
15+
Microsoft.TestPlatform.ObjectModel (>= 17.6.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
1616
Newtonsoft.Json (>= 13.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
1717
MSTest.TestAdapter (2.1.2)
1818
NETStandard.Library (>= 1.6.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp1.0))
@@ -21,8 +21,8 @@ NUGET
2121
NETStandard.Library (2.0.3)
2222
Microsoft.NETCore.Platforms (>= 1.1)
2323
Newtonsoft.Json (13.0.3) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
24-
NHamcrest (3.1)
25-
NuGet.Frameworks (6.6) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
24+
NHamcrest (3.3)
25+
NuGet.Frameworks (6.6.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
2626
NUnit (3.13.3)
2727
NETStandard.Library (>= 2.0)
2828
NUnit3TestAdapter (4.5)
@@ -86,7 +86,7 @@ NUGET
8686
System.IO (>= 4.3)
8787
System.Reflection.Primitives (>= 4.3)
8888
System.Runtime (>= 4.3)
89-
System.Reflection.Metadata (7.0.1) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
89+
System.Reflection.Metadata (7.0.2) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.1))
9090
System.Collections.Immutable (>= 7.0)
9191
System.Reflection.Primitives (4.3)
9292
Microsoft.NETCore.Platforms (>= 1.1)
@@ -117,21 +117,21 @@ NUGET
117117
Microsoft.NETCore.Platforms (>= 1.1)
118118
Microsoft.NETCore.Targets (>= 1.1)
119119
System.Runtime (>= 4.3)
120-
xunit (2.4.2)
121-
xunit.analyzers (>= 1.0)
122-
xunit.assert (>= 2.4.2)
123-
xunit.core (2.4.2)
120+
xunit (2.5)
121+
xunit.analyzers (>= 1.2)
122+
xunit.assert (>= 2.5)
123+
xunit.core (2.5)
124124
xunit.abstractions (2.0.3)
125-
xunit.analyzers (1.1)
126-
xunit.assert (2.4.2)
125+
xunit.analyzers (1.2)
126+
xunit.assert (2.5)
127127
NETStandard.Library (>= 1.6.1)
128-
xunit.core (2.4.2)
129-
xunit.extensibility.core (2.4.2)
130-
xunit.extensibility.execution (2.4.2)
131-
xunit.extensibility.core (2.4.2)
128+
xunit.core (2.5)
129+
xunit.extensibility.core (2.5)
130+
xunit.extensibility.execution (2.5)
131+
xunit.extensibility.core (2.5)
132132
NETStandard.Library (>= 1.6.1)
133133
xunit.abstractions (>= 2.0.3)
134-
xunit.extensibility.execution (2.4.2)
134+
xunit.extensibility.execution (2.5)
135135
NETStandard.Library (>= 1.6.1)
136-
xunit.extensibility.core (2.4.2)
137-
xunit.runner.visualstudio (2.4.5)
136+
xunit.extensibility.core (2.5)
137+
xunit.runner.visualstudio (2.5)

src/FsUnit.Xunit/FsUnit.fs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ open Xunit.Sdk
66
open NHamcrest
77
open NHamcrest.Core
88

9-
type MatchException(expected, actual, userMessage) =
10-
inherit AssertActualExpectedException(expected, actual, userMessage)
11-
129
type Xunit.Assert with
1310

1411
static member That<'a>(actual, matcher: IMatcher<'a>) =
1512
if not(matcher.Matches(actual)) then
1613
let description = StringDescription()
1714
matcher.DescribeTo(description)
1815

19-
let raiseMatchException(value: string) =
20-
raise(MatchException(description.ToString(), value, null))
16+
let raiseEqualException(value: string) =
17+
raise(EqualException.ForMismatchedValues(description.ToString(), value))
2118

2219
match box actual with
2320
| :? (unit -> unit) as actualfunc ->
@@ -26,8 +23,8 @@ type Xunit.Assert with
2623
String.Empty
2724
with ex ->
2825
ex.ToString())
29-
|> raiseMatchException
30-
| _ -> $"%A{actual}" |> raiseMatchException
26+
|> raiseEqualException
27+
| _ -> $"%A{actual}" |> raiseEqualException
3128

3229
let inline should (f: 'a -> ^b) x (actual: obj) =
3330
let matcher = f x
@@ -52,7 +49,7 @@ let inline shouldFail(f: unit -> unit) =
5249
true
5350

5451
if not failed then
55-
raise(MatchException("Method should fail", "No exception raised", null))
52+
raise(ThrowsException.ForNoException(f.GetType()))
5653

5754
let equalSeq expected =
5855
CustomMatchers.equalSeq (fun (e: seq<'a>) (a: seq<'a>) -> Assert.Equal<seq<'a>>(e, a)) expected

tests/FsUnit.Xunit.Test/beGreaterThanTests.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ namespace FsUnit.Test
22

33
open Xunit
44
open FsUnit.Xunit
5+
open Xunit.Sdk
56

67
type ``be greaterThan tests``() =
78
[<Fact>]
@@ -25,8 +26,6 @@ type ``be greaterThan tests``() =
2526
9.2 |> should not' (be greaterThan 9.2)
2627

2728
[<Fact>]
28-
member _.``10 should not be greater than 10 but messages should equal``() =
29+
member _.``10 should not be greater than 10 and should throw EqualException``() =
2930
(fun () -> 10 |> should be (greaterThan 10))
30-
|> fun f -> Assert.Throws<MatchException>(f)
31-
|> fun e -> (e.Expected, e.Actual)
32-
|> should equal ("Greater than 10", "10")
31+
|> should throw typeof<EqualException>

tests/FsUnit.Xunit.Test/beSubsetOfTests.fs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
namespace FsUnit.Test
22

33
open Xunit
4+
open Xunit.Sdk
45
open FsUnit.Xunit
6+
open FsUnitTyped
57

68
type ``be subsetOf tests``() =
79

@@ -34,12 +36,5 @@ type ``be subsetOf tests``() =
3436
[ 1..10 ] |> should be (subsetOf [ 1..10 ])
3537

3638
[<Fact>]
37-
member _.``should fail on '1 to 11 should be subset of 1 to 10'``() =
38-
shouldFail(fun () -> [ 1..11 ] |> should be (subsetOf [ 1..10 ]))
39-
40-
[<Fact>]
41-
member _.``11 should not be subset of 1 to 10 but messages should equal``() =
42-
(fun _ -> [ 11 ] |> should be (subsetOf [ 1..10 ]))
43-
|> fun f -> Assert.Throws<MatchException>(f)
44-
|> fun e -> (e.Expected, e.Actual)
45-
|> should equal ("Is subset of [1; 2; 3; 4; 5; 6; 7; 8; 9; 10]", "[11]")
39+
member _.``should fail on '1 to 11 should be subset of 1 to 10' and check if it's EqualException``() =
40+
shouldFail<EqualException>(fun () -> [ 1..11 ] |> should be (subsetOf [ 1..10 ]))

tests/FsUnit.Xunit.Test/equalTests.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ open System
44
open System.Collections.Immutable
55

66
open Xunit
7+
open Xunit.Sdk
78
open FsUnit.Xunit
89

910
type AlwaysEqual() =
@@ -106,11 +107,9 @@ type ``equal Tests``() =
106107
anImmutableArray |> should not' (equal otherImmutableArray)
107108

108109
[<Fact>]
109-
member _.``Ok "foo" should fail on equal Ok "bar" but message should be equal``() =
110+
member _.``Ok "foo" should fail on equal Ok "bar" and should throw EqualException``() =
110111
(fun () -> Ok "foo" |> should equal (Ok "bar"))
111-
|> fun f -> Assert.Throws<MatchException>(f)
112-
|> fun e -> (e.Expected, e.Actual)
113-
|> should equal ("Equals Ok \"bar\"", "Ok \"foo\"")
112+
|> should throw typeof<EqualException>
114113

115114
[<Fact>]
116115
member _.``structural comparable type containing non-equivalent structural equatable type fails with correct exception``() =

tests/FsUnit.Xunit.Test/haveLengthTests.fs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
namespace FsUnit.Test
22

33
open Xunit
4+
open Xunit.Sdk
45
open FsUnit.Xunit
56

67
type ``haveLength tests``() =
@@ -39,11 +40,9 @@ type ``haveLength tests``() =
3940
shouldFail(fun () -> [| 1 |] |> should not' (haveLength 1))
4041

4142
[<Fact>]
42-
member _.``Array with 1 item should fail to have Length 2 but messages should equal``() =
43+
member _.``Array with 1 item should fail to have Length 2 and should throw EqualException``() =
4344
(fun () -> [| 1 |] |> should haveLength 2)
44-
|> fun f -> Assert.Throws<MatchException>(f)
45-
|> fun e -> (e.Expected, e.Actual)
46-
|> should equal ("Have Length 2", "[|1|]")
45+
|> should throw typeof<EqualException>
4746

4847
// Seq
4948
[<Fact>]

tests/FsUnit.Xunit.Test/shouldFailTests.fs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ namespace FsUnit.Test
33
open System
44
open Xunit
55
open FsUnit.Xunit
6+
open Xunit.Sdk
67

78
type ``shouldFail tests``() =
89

@@ -20,12 +21,17 @@ type ``shouldFail tests``() =
2021

2122
[<Fact>]
2223
member _.``shouldFail should throw an exception``() =
23-
(fun () -> shouldFail id) |> should throw typeof<MatchException>
24+
(fun () -> shouldFail id) |> should throw typeof<ThrowsException>
2425

2526
[<Fact>]
26-
member _.``shouldFail should not throw an exception when fail``() =
27+
member _.``shouldFail should not throw an exception when fail with ThrowsException``() =
2728
(fun () -> shouldFail(fun () -> [] |> should contain 1))
28-
|> should not' (throw typeof<MatchException>)
29+
|> should not' (throw typeof<ThrowsException>)
30+
31+
[<Fact>]
32+
member _.``shouldFail should not throw an exception when fail with EqualException``() =
33+
(fun () -> shouldFail(fun () -> [] |> should contain 1))
34+
|> should not' (throw typeof<EqualException>)
2935

3036
[<Fact>]
3137
member _.``test raising exception``() =

tests/FsUnit.Xunit.Test/shouldStartWithTests.fs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
namespace FsUnit.Test
22

33
open Xunit
4+
open Xunit.Sdk
45
open FsUnit.Xunit
6+
open FsUnitTyped
57

68
type ``should startWith tests``() =
79
[<Fact>]
@@ -17,8 +19,5 @@ type ``should startWith tests``() =
1719
"ships" |> should not' (startWith "ss")
1820

1921
[<Fact>]
20-
member _.``ships should not start with ss but messages should equal``() =
21-
(fun _ -> "ships" |> should startWith "ss")
22-
|> fun f -> Assert.Throws<MatchException>(f)
23-
|> fun e -> (e.Expected, e.Actual)
24-
|> should equal ("ss", "\"ships\"")
22+
member _.``ships should not start with ss and check if it's EqualException``() =
23+
shouldFail<EqualException>(fun _ -> "ships" |> should startWith "ss")

tests/FsUnit.Xunit.Test/typed.shouldBeSmallerThanTests.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ namespace FsUnit.Typed.Test
22

33
open FsUnit.Xunit
44
open Xunit
5+
open Xunit.Sdk
56
open FsUnitTyped
67

78
type ``shouldBeSmallerThan tests``() =
@@ -11,7 +12,7 @@ type ``shouldBeSmallerThan tests``() =
1112

1213
[<Fact>]
1314
member _.``10 should not be less than 10``() =
14-
(fun () -> 10 |> shouldBeSmallerThan 10) |> shouldFail<MatchException>
15+
(fun () -> 10 |> shouldBeSmallerThan 10) |> shouldFail<EqualException>
1516

1617
[<Fact>]
1718
member _.``10[dot]0 should be less than 10[dot]1``() =
@@ -20,5 +21,4 @@ type ``shouldBeSmallerThan tests``() =
2021
[<Fact>]
2122
member _.``10[dot]0 should not be less than 10[dot]0``() =
2223
(fun () -> 10.0 |> shouldBeSmallerThan 10.0)
23-
|> should throw typeof<MatchException>
24-
//|> shouldFail<MatchException>
24+
|> should throw typeof<EqualException>

tests/FsUnit.Xunit.Test/typed.shouldEqualTests.fs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ open System.Collections.Immutable
44

55
open FsUnit.Xunit
66
open Xunit
7+
open Xunit.Sdk
78
open FsUnitTyped
89
open System
910

@@ -81,12 +82,12 @@ type ``shouldEqual Tests``() =
8182
[<Fact>]
8283
member _.``Error "Foo" should equal fails and have same message``() =
8384
(fun () -> Error "Foo" |> shouldEqual(Error "Bar"))
84-
|> Assert.Throws<MatchException>
85+
|> Assert.Throws<EqualException>
8586
|> fun e ->
8687
e.Message
8788
|> shouldEqual(
8889
sprintf
89-
"Exception of type 'FsUnit.Xunit+MatchException' was thrown.%sExpected: Equals Error \"Bar\"%sActual: Error \"Foo\""
90+
"Assert.Equal() Failure: Values differ%sExpected: Equals Error \"Bar\"%sActual: Error \"Foo\""
9091
Environment.NewLine
9192
Environment.NewLine
9293
)
@@ -98,12 +99,12 @@ type ``shouldEqual Tests``() =
9899
[<Fact>]
99100
member _.``Error "Foo" should not equal Error "Bar" fails and have same message``() =
100101
(fun () -> Error "Foo" |> shouldNotEqual(Error "Foo"))
101-
|> Assert.Throws<MatchException>
102+
|> Assert.Throws<EqualException>
102103
|> fun e ->
103104
e.Message
104105
|> shouldEqual(
105106
sprintf
106-
"Exception of type 'FsUnit.Xunit+MatchException' was thrown.%sExpected: not Equals Error \"Foo\"%sActual: Error \"Foo\""
107+
"Assert.Equal() Failure: Values differ%sExpected: not Equals Error \"Foo\"%sActual: Error \"Foo\""
107108
Environment.NewLine
108109
Environment.NewLine
109110
)

0 commit comments

Comments
 (0)