diff --git a/src/Faqt/HigherOrderAssertions.fs b/src/Faqt/HigherOrderAssertions.fs index e518ec4..0e0d491 100644 --- a/src/Faqt/HigherOrderAssertions.fs +++ b/src/Faqt/HigherOrderAssertions.fs @@ -55,20 +55,20 @@ type HigherOrderAssertions = use _ = t.Assert(true) let assertions = assertions |> Seq.toArray - let exceptions = - assertions - |> Array.choose (fun f -> - try - f t.Subject |> ignore - None - with :? AssertionFailedException as ex -> - Some ex - ) - - if assertions.Length > 0 && exceptions.Length = assertions.Length then - t - .With("Failures", exceptions |> Array.map (fun ex -> ex.FailureData)) - .Fail(because) + if assertions.Length > 0 then + let failures = ResizeArray() + let mutable succeeded = false + + for f in assertions do + if not succeeded then + try + f t.Subject |> ignore + succeeded <- true + with :? AssertionFailedException as ex -> + failures.Add ex.FailureData + + if not succeeded then + t.With("Failures", failures).Fail(because) And(t)