Skip to content

Commit

Permalink
Tidy connection logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Dec 7, 2019
1 parent ea382e1 commit 0b2c4b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions equinox-fc/Domain.Tests/Infrastructure.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ module Cosmos =
open Equinox.Cosmos
let connect () =
match EnvVar.tryGet "EQUINOX_COSMOS_CONNECTION", EnvVar.tryGet "EQUINOX_COSMOS_DATABASE", EnvVar.tryGet "EQUINOX_COSMOS_CONTAINER" with
| Some s,Some d,Some c ->
| Some s, Some d, Some c ->
let appName = "Domain.Tests"
let discovery = Discovery.FromConnectionString s
let connector = Connector(TimeSpan.FromSeconds 5., 1, TimeSpan.FromSeconds 5., Serilog.Log.Logger)
let connection = connector.Connect(appName,discovery) |> Async.RunSynchronously
let context = Context(connection,d,c)
let connector = Connector(TimeSpan.FromSeconds 5., 5, TimeSpan.FromSeconds 5., Serilog.Log.Logger)
let connection = connector.Connect(appName, discovery) |> Async.RunSynchronously
let context = Context(connection, d, c)
let cache = Equinox.Cache (appName, 10)
context,cache
context, cache
| s,d,c ->
failwithf "Connection, Database and Container EQUINOX_COSMOS_* Environment variables are required (%b,%b,%b)"
(Option.isSome s) (Option.isSome d) (Option.isSome c)
Expand Down
2 changes: 1 addition & 1 deletion equinox-fc/Domain.Tests/LocationTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Cosmos(testOutput) =
let log = testOutput |> TestOutputAdapter |> createLogger
do Serilog.Log.Logger <- log

let [<Property>] properties maxEvents args =
let [<Property(MaxTest=10)>] properties maxEvents args =
let zeroBalance = 0
let maxEvents = max 1 maxEvents
let shouldClose (state : Epoch.Folds.OpenState) = state.count > maxEvents
Expand Down

0 comments on commit 0b2c4b6

Please sign in to comment.