コード例 #1
0
        public void GetHeader_WhenHeaderDoesNotExists_ThrowsException()
        {
            Dictionary <string, string> mockHeaders = new Dictionary <string, string>();

            mockHeaders.Add("Header1", "Value1");
            mockHeaders.Add("Header3", "Value3");

            HttpClientResponse response = new HttpClientResponse("Content", mockHeaders, true);

            Assert.AreEqual("Value1", response.GetHeader("Header1"));
            Assert.AreEqual("Value3", response.GetHeader("Header3"));
            response.GetHeader("Header2");
        }