anchor.diff:                  |> Doc.toList
               Expect.contains actualDogs expectedDog "Should contain same dog!"
               Expect.contains actualDogs expectedDog2 "Should contain same dog!"
  -        }
  -    testCase', "toList, no dogs, get empty list" ,
  -        fun db store -> async {
  +
  +    testCase'
  +        "toList, no dogs, get empty list" <|
  +        fun (db, store) ->
               use session = store.OpenSession()
               let actualDogs =
                   session
                   |> Doc.query<Dog>
                   |> Doc.toList
               Expect.isEmpty actualDogs "Should be no dogs!"
  -        }
  -    testCaseAsync', "toListAsync, single dog, get single back" ,
  -        fun db store -> async {
  -            let expectedDog = saveDog' store
  -            use session = store.OpenSession()
  -            let! actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toListAsync
  -            Expect.contains actualDogs expectedDog "Should contain same dog!"
  -        }
  -    testCaseAsync', "toListAsync, multiple dogs, get multple back" ,
  -        fun db store -> async {
  -            let expectedDog = saveDog' store
  -            let expectedDog2 = saveDog' store
  -            use session = store.OpenSession()
  -            let! actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toListAsync
  -            Expect.contains actualDogs expectedDog "Should contain same dog!"
  -            Expect.contains actualDogs expectedDog2 "Should contain same dog!"
  -        }
  -    testCaseAsync', "toListAsync, no dogs, get empty list" ,
  -        fun db store -> async {
  -            use session = store.OpenSession()
  -            let! actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toListAsync
  -            Expect.isEmpty actualDogs "Should be no dogs!"
  -        }
  +
  +    testCaseAsync'
  +        "toListAsync, single dog, get single back" <|
  +            fun (db, store) -> async {
  +                let expectedDog = saveDog' store
  +                use session = store.OpenSession()
  +                let! actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toListAsync
  +                Expect.contains actualDogs expectedDog "Should contain same dog!"
  +            }
  +    testCaseAsync'
  +        "toListAsync, multiple dogs, get multple back" <|
  +            fun (db, store) -> async {
  +                let expectedDog = saveDog' store
  +                let expectedDog2 = saveDog' store
  +                use session = store.OpenSession()
  +                let! actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toListAsync
  +                Expect.contains actualDogs expectedDog "Should contain same dog!"
  +                Expect.contains actualDogs expectedDog2 "Should contain same dog!"
  +            }
  +    testCaseAsync'
  +        "toListAsync, no dogs, get empty list" <|
  +            fun (db, store) -> async {
  +                use session = store.OpenSession()
  +                let! actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toListAsync
  +                Expect.isEmpty actualDogs "Should be no dogs!"
  +            }
   ]
   
   
   let CRUDTests = [
  -    testCase', "loadByGuid, Get Some Record back" ,
  -        fun db store -> async {
  -            let expectedDog = saveDog' store
  -            use session = store.OpenSession()
  -            let actualDog =
  -                session
  -                |> Doc.loadByGuid<Dog> expectedDog.Id
  -            Expect.equal (Some expectedDog) actualDog  "Same dog!"
  -        }
  -    testCase', "loadByGuid, Get None Record back" ,
  -        fun db store -> async {
  -            let _ = saveDog' store
  -            use session = store.OpenSession()
  -            let actualDog =
  -                session
  -                |> Doc.loadByGuid<Dog> (Guid.NewGuid())
  -            Expect.equal None actualDog  "Should be no dog!"
  -        }
  -    testCaseAsync', "loadByGuidAsync, get Some record back",
  -        fun db store -> async {
  -            let expectedDog = saveDog' store
  -            use session = store.OpenSession()
  -            let! actualDog =
  -                session
  -                |> Doc.loadByGuidAsync<Dog> expectedDog.Id
  -
  -            Expect.equal (Some expectedDog) actualDog  "Same dog!"
  -        }
  -    testCaseAsync', "loadByGuidAsync, get None record back",
  -        fun db store -> async {
  -            let expectedDog = saveDog' store
  -            use session = store.OpenSession()
  -            let! actualDog =
  -                session
  -                |> Doc.loadByGuidAsync<Dog> (Guid.NewGuid())
  -
  -            Expect.equal None actualDog  "Should be no dog!"
  -        }
  -    testCase', "storeSingle/saveChanges" ,
  -        fun db (store : #IDocumentStore) -> async {
  -            let sparky = newDog "Sparky" "Shoes"
  -
  -            use session = store.OpenSession()
  -            sparky |> Doc.storeSingle session
  -            session |> Doc.saveChanges
  -            let actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toList
  -            Expect.contains actualDogs sparky "Should contain same dog!"
  -
  -        }
  -    testCase', "storeMany/delete/saveChanges" ,
  -        fun db (store : #IDocumentStore) -> async {
  -            let sparky = newDog "Sparky" "Shoes"
  -            let spot = newDog "Spot" "Macbook"
  -
  -            use session = store.OpenSession()
  -            [sparky ; spot] |> Doc.storeMany session
  -            session |> Doc.saveChanges
  -            let actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toList
  -            Expect.contains actualDogs sparky "Should contain same dog!"
  -            Expect.contains actualDogs spot "Should contain same dog!"
  -
  -            session |> Doc.deleteEntity spot
  -            session |> Doc.saveChanges
  -            let actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toList
  -            Expect.contains actualDogs sparky "Should contain same dog!"
  -
  -            session |> Doc.deleteByGuid<Dog> sparky.Id
  -            session |> Doc.saveChanges
  -            let actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toList
  -            Expect.isEmpty actualDogs "Should be no more dogs"
  -
  -        }
  -    testCaseAsync', "storeSingle/saveChangesAsync" ,
  -        fun db (store : #IDocumentStore) -> async {
  -            let sparky = newDog "Sparky" "Shoes"
  -
  -            use session = store.OpenSession()
  -            sparky |> Doc.storeSingle session
  -            do! session |> Doc.saveChangesAsync
  -            let! actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toListAsync
  -            Expect.contains actualDogs sparky "Should contain same dog!"
  -
  -        }
  -    testCaseAsync', "storeMany/saveChangesAsync" ,
  -        fun db (store : #IDocumentStore) -> async {
  -            let sparky = newDog "Sparky" "Shoes"
  -            let spot = newDog "Spot" "Macbook"
  -
  -            use session = store.OpenSession()
  -            [sparky ; spot] |> Doc.storeMany session
  -            do! session |> Doc.saveChangesAsync
  -            let! actualDogs =
  -                session
  -                |> Doc.query<Dog>
  -                |> Doc.toListAsync
  -            Expect.contains actualDogs sparky "Should contain same dog!"
  -            Expect.contains actualDogs spot "Should contain same dog!"
  -
  -        }
  +    testCase'
  +        "loadByGuid, Get Some Record back" <|
  +            fun (db, store) ->
  +                let expectedDog = saveDog' store
  +                use session = store.OpenSession()
  +                let actualDog =
  +                    session
  +                    |> Doc.loadByGuid<Dog> expectedDog.Id
  +                Expect.equal (Some expectedDog) actualDog  "Same dog!"
  +    testCase'
  +        "loadByGuid, Get None Record back" <|
  +            fun (db, store) ->
  +                let _ = saveDog' store
  +                use session = store.OpenSession()
  +                let actualDog =
  +                    session
  +                    |> Doc.loadByGuid<Dog> (Guid.NewGuid())
  +                Expect.equal None actualDog  "Should be no dog!"
  +    testCaseAsync'
  +        "loadByGuidAsync, get Some record back" <|
  +            fun (db, store) -> async {
  +                let expectedDog = saveDog' store
  +                use session = store.OpenSession()
  +                let! actualDog =
  +                    session
  +                    |> Doc.loadByGuidAsync<Dog> expectedDog.Id
  +
  +                Expect.equal (Some expectedDog) actualDog  "Same dog!"
  +            }
  +    testCaseAsync'
  +        "loadByGuidAsync, get None record back" <|
  +            fun (db, store) -> async {
  +                let expectedDog = saveDog' store
  +                use session = store.OpenSession()
  +                let! actualDog =
  +                    session
  +                    |> Doc.loadByGuidAsync<Dog> (Guid.NewGuid())
  +
  +                Expect.equal None actualDog  "Should be no dog!"
  +            }
  +    testCase'
  +        "storeSingle/saveChanges" <|
  +            fun (db, store) ->
  +                let sparky = newDog "Sparky" "Shoes"
  +
  +                use session = store.OpenSession()
  +                sparky |> Doc.storeSingle session
  +                session |> Doc.saveChanges
  +                let actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toList
  +                Expect.contains actualDogs sparky "Should contain same dog!"
  +
  +
  +    testCase'
  +        "storeMany/delete/saveChanges" <|
  +            fun (db, store) ->
  +                let sparky = newDog "Sparky" "Shoes"
  +                let spot = newDog "Spot" "Macbook"
  +
  +                use session = store.OpenSession()
  +                [sparky ; spot] |> Doc.storeMany session
  +                session |> Doc.saveChanges
  +                let actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toList
  +                Expect.contains actualDogs sparky "Should contain same dog!"
  +                Expect.contains actualDogs spot "Should contain same dog!"
  +
  +                session |> Doc.deleteEntity spot
  +                session |> Doc.saveChanges
  +                let actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toList
  +                Expect.contains actualDogs sparky "Should contain same dog!"
  +
  +                session |> Doc.deleteByGuid<Dog> sparky.Id
  +                session |> Doc.saveChanges
  +                let actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toList
  +                Expect.isEmpty actualDogs "Should be no more dogs"
  +
  +
  +    testCaseAsync'
  +        "storeSingle/saveChangesAsync" <|
  +            fun (db, store) -> async {
  +                let sparky = newDog "Sparky" "Shoes"
  +
  +                use session = store.OpenSession()
  +                sparky |> Doc.storeSingle session
  +                do! session |> Doc.saveChangesAsync
  +                let! actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toListAsync
  +                Expect.contains actualDogs sparky "Should contain same dog!"
  +
  +            }
  +    testCaseAsync'
  +        "storeMany/saveChangesAsync" <|
  +            fun (db, store) -> async {
  +                let sparky = newDog "Sparky" "Shoes"
  +                let spot = newDog "Spot" "Macbook"
  +
  +                use session = store.OpenSession()
  +                [sparky ; spot] |> Doc.storeMany session
  +                do! session |> Doc.saveChangesAsync
  +                let! actualDogs =
  +                    session
  +                    |> Doc.query<Dog>
  +                    |> Doc.toListAsync
  +                Expect.contains actualDogs sparky "Should contain same dog!"
  +                Expect.contains actualDogs spot "Should contain same dog!"
  +            }
   ]
   
   [<CLIMutableAttribute>]
  
positive.code:                     |> Doc.head
                  Expect.isType<User> (box actualUser) "Should be User type"
                  Expect.equal expectedDog.Name actualUser.Name  "Should be a user!"
              }
  ]
  
  let headTests = [
      testCase', "head, single dog, Get Record Back" ,
          fun db store -> async {
              let expectedDog = saveDog' store
              use session = store.OpenSession()
              let actualDog =
                  session
                  |> Doc.query<Dog>
                  |> Doc.head
              Expect.equal expectedDog actualDog  "Should be a same dog!"
          }
      testCase', "head, multiple dogs, get top record back" ,
          fun db store -> async {
              let expectedDog = saveDog' store
              let _ = saveDog' store
              use session = store.OpenSession()
              let actualDog =
                  session
                  |> Doc.query<Dog>
                  |> Doc.head
              Expect.equal expectedDog actualDog  "Should be a same dog!"
          }
      testCase', "head, no dogs, throws exception" ,
          fun db store -> async {
              Expect.throwsT<InvalidOperationException>(fun _ ->
              use session = store.OpenSession()
              let actualDog =
                  session
                      |> Doc.query<Dog>
                      |> Doc.head
              ()
              ) "Should be no dog!"
          }
  
      testCaseAsync', "headAsync, single dog, Get Record Back" ,
          fun db store -> async {
              let expectedDog = saveDog' store
              use session = store.OpenSession()
              let! actualDog =
                  session
                  |> Doc.query<Dog>
                  |> Doc.headAsync
              Expect.equal expectedDog actualDog  "Should be a same dog!"
          }
      testCaseAsync', "headAsync, multiple dogs, get top record back" ,
          fun db store -> async {
              let expectedDog = saveDog' store
              let _ = saveDog' store
              use session = store.OpenSession()
              let! actualDog =
                  session
                  |> Doc.query<Dog>
                  |> Doc.headAsync
              Expect.equal expectedDog actualDog  "Should be a same dog!"
          }
      testCaseAsync', "headAsync, no dogs, throws exception" ,
          fun db store -> async {
              do!
                  Expect.throwsTAsync<AggregateException>(async {
                      use session = store.OpenSession()
                      let! actualDog =
                          session
                              |> Doc.query<Dog>
                              |> Doc.headAsync
                      ()
                  }) "Should be no dog!"
          }
  ]
  
  
  let toListTests = [
      testCase', "toList, single dog, get single back" ,
          fun db store -> async {
              let expectedDog = saveDog' store
              use session = store.OpenSession()
              let actualDogs =
                  session
                  |> Doc.query<Dog>
                  |> Doc.toList
              Expect.contains actualDogs expectedDog "Should contain same dog!"
          }
      testCase', "toList, multiple dogs, get multple back" ,
          fun db store -> async {
              let expectedDog = saveDog' store
              let expectedDog2 = saveDog' store
              use session = store.OpenSession()
  
negative.code: 
  open System.Reflection
  open Microsoft.FSharp.Reflection
  let inline withDatabaseAndStore (f : _ -> _)  = async {
      use database =  getNewDatabase ()
      use store = getStore database :> IDocumentStore
      return! f (database, store)
  }
  
  type ParameterizedTest<'a> =
      | Sync of string * ('a -> unit)
      | Async of string * ('a -> Async<unit>)
  
  
  let testCase' name test =
       ParameterizedTest.Sync(name,test)
  
  let testCaseAsync' name test  =
      ParameterizedTest.Async(name,test)
  
  let inline testFixture'<'a> setup =
      Seq.map (fun ( parameterizedTest : ParameterizedTest<'a>) ->
          match parameterizedTest with
          | Sync (name, test) ->
              testCase name <| fun () -> test >> async.Return |> setup |> Async.RunSynchronously
          | Async (name, test) ->
              testCaseAsync name <| setup test
  
      )
  
  
  [<Tests>]
  let ``Litmus Tests`` =
    testList "litmus Tests" [
      yield! testFixture withDatabase [
          "Can create/destroy database", ignore
          "Can Save/Load Record",
  