public async Task GetFlagsUsesCorrectUriAndMethodInGetModeAsync(
            string baseUriExtraPath,
            bool withReasons,
            string expectedPathWithoutUser,
            string expectedQuery
            )
        {
            using (var server = HttpServer.Start(Handlers.BodyJson(_allDataJson)))
            {
                var baseUri = new Uri(server.Uri.ToString().TrimEnd('/') + baseUriExtraPath);

                var config = Configuration.Default(_mobileKey);

                using (var requestor = new FeatureFlagRequestor(
                           baseUri,
                           _user,
                           withReasons,
                           new LdClientContext(config).Http,
                           testLogger))
                {
                    var resp = await requestor.FeatureFlagsAsync();

                    Assert.Equal(200, resp.statusCode);
                    Assert.Equal(_allDataJson, resp.jsonResponse);

                    var req = server.Recorder.RequireRequest();
                    Assert.Equal("GET", req.Method);
                    Assert.Equal(expectedPathWithoutUser + _encodedUser, req.Path);
                    Assert.Equal(expectedQuery, req.Query);
                    Assert.Equal(_mobileKey, req.Headers["Authorization"]);
                    Assert.Equal("", req.Body);
                }
            }
        }
        public async Task GetFlagsUsesCorrectUriAndMethodInReportModeAsync(
            string baseUriExtraPath,
            bool withReasons,
            string expectedPath,
            string expectedQuery
            )
        {
            using (var server = HttpServer.Start(Handlers.BodyJson(_allDataJson)))
            {
                var baseUri = new Uri(server.Uri.ToString().TrimEnd('/') + baseUriExtraPath);

                var config = Configuration.Builder(_mobileKey)
                             .Http(Components.HttpConfiguration().UseReport(true))
                             .Build();

                using (var requestor = new FeatureFlagRequestor(
                           baseUri,
                           _user,
                           withReasons,
                           new LdClientContext(config).Http,
                           testLogger))
                {
                    var resp = await requestor.FeatureFlagsAsync();

                    Assert.Equal(200, resp.statusCode);
                    Assert.Equal(_allDataJson, resp.jsonResponse);

                    var req = server.Recorder.RequireRequest();
                    Assert.Equal("REPORT", req.Method);
                    Assert.Equal(expectedPath, req.Path);
                    Assert.Equal(expectedQuery, req.Query);
                    Assert.Equal(_mobileKey, req.Headers["Authorization"]);
                    AssertJsonEqual(LdJsonSerialization.SerializeObject(_user),
                                    TestUtil.NormalizeJsonUser(LdValue.Parse(req.Body)));
                }
            }
        }