public async void Method()
        {
            var httpHandler = new MockHttpHandler();
            var responseHandler = new MockResponseHandler<object>();

            var endpoint = new HttpApiEndpoint("path/to/api", HttpMethod.Get, new Dictionary<string, IHttpArgumentHandler>(), responseHandler, Enumerable.Empty<HttpHeader>());
            await endpoint.Call(httpHandler, "http://localhost", new Dictionary<string, object>());

            Assert.AreEqual(HttpMethod.Get, httpHandler.Request.Method);
        }
        public async Task Method()
        {
            var httpHandler     = new MockHttpHandler();
            var responseHandler = new MockResponseHandler <object>();

            var endpoint = new HttpApiEndpoint(null, "path/to/api", HttpMethod.Get, new Dictionary <string, IHttpArgumentHandler>(), responseHandler, Enumerable.Empty <HttpHeader>());
            await endpoint.Call(httpHandler, "http://localhost", new Dictionary <string, object>());

            Assert.AreEqual(HttpMethod.Get, httpHandler.Request.Method);
        }
        public async void HeadersProvider()
        {
            var httpHandler = new MockHttpHandler();
            var responseHandler = new MockResponseHandler<object>();

            var headersProvider = new MockApiInstrumenter();
            headersProvider.Headers.Add(new HttpHeader("key", "value"));

            var endpoint = new HttpApiEndpoint("path/to/api", HttpMethod.Get, new Dictionary<string, IHttpArgumentHandler>(), responseHandler, Enumerable.Empty<HttpHeader>());
            await endpoint.Call(httpHandler, "http://localhost", new Dictionary<string, object>(), headersProvider.InstrumentCall);

            var header = httpHandler.Request.Headers.Single();
            Assert.AreEqual("key", header.Name);
            Assert.AreEqual("value", header.Values.Single());
        }
        public async Task HeadersProvider()
        {
            var httpHandler     = new MockHttpHandler();
            var responseHandler = new MockResponseHandler <object>();

            var headersProvider = new MockApiInstrumenter();

            headersProvider.Headers.Add(new HttpHeader("key", "value"));

            var endpoint = new HttpApiEndpoint(null, "path/to/api", HttpMethod.Get, new Dictionary <string, IHttpArgumentHandler>(), responseHandler, Enumerable.Empty <HttpHeader>());
            await endpoint.Call(httpHandler, "http://localhost", new Dictionary <string, object>(), headersProvider.InstrumentCall);

            var header = httpHandler.Request.Headers.Single();

            Assert.AreEqual("key", header.Name);
            Assert.AreEqual("value", header.Values.Single());
        }
        public async void ArgumentProvider()
        {
            var httpHandler = new MockHttpHandler();
            var responseHandler = new MockResponseHandler<string>(x => x.Headers.Single(y => y.Name == "name").Values.Single());

            var endpoint = new HttpApiEndpoint(
                "path/to/api",
                HttpMethod.Get,
                new Dictionary<string, IHttpArgumentHandler>
                {
                    { "name", new HttpHeaderArgumentHandler(DefaultTypeConverter.Create())  }
                },
                responseHandler,
                Enumerable.Empty<HttpHeader>());
            var response = await endpoint.Call(httpHandler, "http://localhost", new Dictionary<string, object> { ["name"] = "value" });

            Assert.AreEqual("value", response);
        }
        public async Task ArgumentProvider()
        {
            var httpHandler     = new MockHttpHandler();
            var responseHandler = new MockResponseHandler <string>(x => x.Headers.Single(y => y.Name == "name").Values.Single());

            var endpoint = new HttpApiEndpoint(
                null,
                "path/to/api",
                HttpMethod.Get,
                new Dictionary <string, IHttpArgumentHandler>
            {
                { "name", new HttpHeaderArgumentHandler(DefaultTypeConverter.Create()) }
            },
                responseHandler,
                Enumerable.Empty <HttpHeader>());
            var response = await endpoint.Call(httpHandler, "http://localhost", new Dictionary <string, object> {
                ["name"] = "value"
            });

            Assert.AreEqual("value", response);
        }