I’m trying to write tests for my SAFE project, that is using SATURN in back end. In the test functions, I’m using Expect, and trying to match the return of my database with some expected results, but I can’t figure out how should i do this. I’ve tried this:
testCase "Add valid Book" <| fun _ ->
let myProvisoryBook = {id="2"; title="A tilte"; author="an author"}
let connection = new SqliteConnection(connectionString)
let insertResult = Books.Database.insert connectionString myProvisoryBook
let expectedResult = Ok ()
Expect.equal insertResult expectedResult "Result should be ok"
ERROR:
This expression was expected to have type
'System.Threading.Tasks.Task<Result<int,exn>>'
but here has type
'Result<unit,'a>'
What am I doing wrong? How can I do this tests in the correct way?