File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ module CustomConstraints =
17
17
let result = Common.isOfCase this.Expected actual
18
18
ConstraintResult( this, actual, result)
19
19
else
20
- failwith " Value (not expression) is not a union case."
20
+ failwith $ " Value (not expression) is not a union case. Got a {actual.GetType().Name} ."
Original file line number Diff line number Diff line change @@ -185,10 +185,10 @@ let instanceOfType<'a> =
185
185
let contain expected =
186
186
let matches ( actual : obj ) =
187
187
match actual with
188
- | :? list<_> as l -> l |> List.exists( fun i -> i = expected)
189
- | :? array<_> as a -> a |> Array.exists( fun i -> i = expected)
190
- | :? seq<_> as s -> s |> Seq.exists( fun i -> i = expected)
191
- | :? IEnumerable as e -> e |> Seq.cast |> Seq.exists( fun i -> i = expected)
188
+ | :? list<_> as l -> l |> List.exists((=) expected)
189
+ | :? array<_> as a -> a |> Array.exists((=) expected)
190
+ | :? seq<_> as s -> s |> Seq.exists((=) expected)
191
+ | :? IEnumerable as e -> e |> Seq.cast |> Seq.exists((=) expected)
192
192
| _ -> false
193
193
194
194
CustomMatcher< obj>( $" Contains %A {expected}" , Func<_, _> matches)
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ type ``be ofCase tests``() =
43
43
[<Test>]
44
44
member _. ``Given a non - union case as value argument throws an exception`` () =
45
45
( fun () -> 5 |> should not' ( be ofCase <@ Second 5 @>) |> ignore)
46
- |> should ( throwWithMessage " Value (not expression) is not a union case." ) typeof< System.Exception>
46
+ |> should ( throwWithMessage " Value (not expression) is not a union case. Got a Int32. " ) typeof< System.Exception>
47
47
48
48
[<Test>]
49
49
member _. ``None should be ofCase None`` () =
You can’t perform that action at this time.
0 commit comments