public void CreateProtocolResponse_WhenHttpErrorIsReceived_ExceptionIsThrown()
        {
            var responseParameters = new Dictionary<string, string>()
            {
                { "error", "value1"},
                { "error_description", "value2"}
            };

            HttpResponseMessage httpResponse = CreateJsonHttpResponse(HttpStatusCode.BadRequest, responseParameters);

            var responseAdapter = new JsonHttpResponseAdapter();

            Assert.Throws<Exception>(() => responseAdapter.CreateProtocolResponse(httpResponse));
        }
        public void CreateProtocolResponse_WithCorrectHttpResponse_ProtocolResponseIsCorrect()
        {
            var responseParameters = new Dictionary<string, string>()
            {
                { "attr1", "value1"},
                { "attr2", "value2"}
            };

            HttpResponseMessage httpResponse = CreateJsonHttpResponse(HttpStatusCode.OK, responseParameters);

            var responseAdapter = new JsonHttpResponseAdapter();

            ProtocolResponse receivedResponse = responseAdapter.CreateProtocolResponse(httpResponse);

            Assert.AreEqual("value1", receivedResponse.BodyParameters["attr1"]);
            Assert.AreEqual("value2", receivedResponse.BodyParameters["attr2"]);
        }