Skip to content

Commit 22b1cd6

Browse files
sheridanchrisTheAngryByrd
authored andcommitted
Update tests to use testCaseTask
1 parent 0e31d5c commit 22b1cd6

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

tests/FsToolkit.ErrorHandling.TaskResult.Tests/TaskResult.fs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -827,15 +827,21 @@ let TaskResultOperatorTests =
827827
[<Tests>]
828828
let 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
]

0 commit comments

Comments
 (0)