File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed
tests/FsToolkit.ErrorHandling.TaskResult.Tests Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -827,15 +827,21 @@ let TaskResultOperatorTests =
827827[<Tests>]
828828let TaskResultBindRequireTests =
829829 testList " TeskResult Bind + Require Tests" [
830- testCase " bindRequireNone"
831- <| fun _ ->
832- let user = Some " john_doe" |> Ok |> Task.singleton
833- let error = user |> TaskResult.bindRequireNone " User exists"
834- error |> Expect.hasTaskErrorValueSync " User exists"
830+ testCaseTask " bindRequireNone"
831+ <| fun _ -> task {
832+ do !
833+ Some " john_doe"
834+ |> TaskResult.ok
835+ |> TaskResult.bindRequireNone " User exists"
836+ |> Expect.hasTaskErrorValue " User exists"
837+ }
835838
836- testCase " bindRequireSome"
837- <| fun _ ->
838- let user = Some " john_doe" |> Ok |> Task.singleton
839- let error = user |> TaskResult.bindRequireSome " User doesn't exist"
840- error |> Expect.hasTaskOkValueSync " john_doe"
839+ testCaseTask " bindRequireSome"
840+ <| fun _ -> task {
841+ do !
842+ Some " john_doe"
843+ |> TaskResult.ok
844+ |> TaskResult.bindRequireSome " User doesn't exist"
845+ |> Expect.hasTaskOkValue " john_doe"
846+ }
841847 ]
You can’t perform that action at this time.
0 commit comments