Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pchalamet committed Dec 28, 2024
1 parent c23dce7 commit e2683cd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/FSharp.MongoDB.Bson.Tests/SerializationTestHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ open FSharp.MongoDB.Bson.Serialization
[<AutoOpen>]
module Helpers =

let serialize value =
let serialize<'T> (value: 'T) =
FSharpValueSerializer.register()

let doc = BsonDocument()
use writer = new BsonDocumentWriter(doc, BsonDocumentWriterSettings.Defaults)
let args = BsonSerializationArgs(value.GetType(), false, false)
let typ = typeof<'T>
let args = BsonSerializationArgs(typ, true, true)
BsonSerializer.Serialize(writer, value, args = args)
doc

Expand Down

0 comments on commit e2683cd

Please sign in to comment.