Skip to content

Commit

Permalink
Straggler converter
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Jan 15, 2022
1 parent d504f2e commit 5680f47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion samples/Store/Domain/Infrastructure.fs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module Guid =
/// - Ensures canonical rendering without dashes via ToString + Newtonsoft.Json
/// - Guards against XSS by only permitting initialization based on Guid.Parse
/// - Implements comparison/equality solely to enable tests to leverage structural equality
[<Sealed; AutoSerializable(false); JsonConverter(typeof<SkuIdJsonConverter>)>]
[<Sealed; AutoSerializable(false); JsonConverter(typeof<SkuIdJsonConverter>); System.Text.Json.Serialization.JsonConverter(typeof<SkuIdJsonConverterStj>)>]
type SkuId private (id : string) =
inherit StringId<SkuId>(id)
new(value : Guid) = SkuId(value.ToString "N")
Expand All @@ -57,6 +57,10 @@ and private SkuIdJsonConverter() =
override __.Pickle value = string value
/// Input must be a `Guid.Parse`able value
override __.UnPickle input = Guid.Parse input |> SkuId
and private SkuIdJsonConverterStj() =
inherit FsCodec.SystemTextJson.JsonIsomorphism<SkuId, string>()
override _.Pickle value = string value
override _.UnPickle input = Guid.Parse input |> SkuId

/// RequestId strongly typed id, represented internally as a string
/// - Ensures canonical rendering without dashes via ToString, Newtonsoft.Json, sprintf "%s" etc
Expand Down
2 changes: 1 addition & 1 deletion tests/Equinox.CosmosStore.Integration/CosmosIntegration.fs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ type Tests(testOutputHelper) =
test <@ addRemoveCount = match state with { items = [{ quantity = quantity }] } -> quantity | _ -> failwith "nope" @>

test <@ List.replicate (expectedResponses transactions) EqxAct.ResponseBackward @ [EqxAct.QueryBackward] = capture.ExternalCalls @>
if eventsInTip then verifyRequestChargesMax 8 // 7.46
if eventsInTip then verifyRequestChargesMax 9 // 8.05
else verifyRequestChargesMax 15 // 14.01
}

Expand Down

0 comments on commit 5680f47

Please sign in to comment.