anchor.diff:  open Microsoft.AspNetCore.Hosting
   open Microsoft.AspNetCore.TestHost
   open Microsoft.Extensions.DependencyInjection
  +open FSharp.Control.Tasks.V2.ContextInsensitive
   open Xunit
   
   // ---------------------------------
  
positive.code: 
  [<Fact>]
  let ``Test / is routed to index`` () =
      use server = new TestServer(createHost())
      use client = server.CreateClient()
  
      get client "/"
      |> ensureSuccess
      |> readText
      |> shouldEqual "index"
  
  [<Fact>]
  let ``Test /error returns status code 500`` () =
      use server = new TestServer(createHost())
      use client = server.CreateClient()
  
      get client "/error"
      |> isStatus HttpStatusCode.InternalServerError
      |> readText
      |> shouldEqual "Something went wrong!"
  
  [<Fact>]
  let ``Test /user returns error when not logged in`` () =
      use server = new TestServer(createHost())
      use client = server.CreateClient()
  
      get client "/user"
      |> isStatus HttpStatusCode.Unauthorized
      |> readText
      |> shouldEqual "Access Denied"
  
  [<Fact>]
  let ``Test /user/{id} returns success when logged in as user`` () =
      use server = new TestServer(createHost())
      use client = server.CreateClient()
  
      let loginResponse =
          get client "/login"
          |> ensureSuccess
  
      loginResponse
      |> readText
      |> shouldEqual "Successfully logged in"
  
      // https://github.com/aspnet/Hosting/issues/191
      // The session cookie is not automatically forwarded to the next request.
      // To overcome this we have to manually do:
      "/user/1"
      |> createRequest HttpMethod.Get
      |> addCookiesFromResponse loginResponse
      |> makeRequest client
      |> ensureSuccess
      |> readText
      |> shouldEqual "User ID: 1"
negative.code: // Helper functions
  // ---------------------------------
  
  let get (client : HttpClient) (path : string) =
      path
      |> client.GetAsync
  
  let createRequest (method : HttpMethod) (path : string) =
      let url = "http://127.0.0.1" + path
  