Beispiel #1
0
        public void TryGetValidHeaderShouldReturnIt()
        {
            HttpHeader httpHeader = new HttpHeader("name", "pesho");

            HttpHeaderCollection headerCollection = new HttpHeaderCollection();

            headerCollection.Add(httpHeader);

            Assert.Equal <HttpHeader>(httpHeader, headerCollection.GetHeader(httpHeader.Key));
        }
Beispiel #2
0
        public void TryGetInvalidHeaderShouldReturnNull()
        {
            HttpHeader httpHeader = new HttpHeader("name", "pesho");

            HttpHeaderCollection headerCollection = new HttpHeaderCollection();

            headerCollection.Add(httpHeader);

            Assert.Null(headerCollection.GetHeader("age"));
        }
Beispiel #3
0
        public void TryGetHeaderWithoutKeyShouldThrowException()
        {
            HttpHeader httpHeader = new HttpHeader("name", "pesho");

            HttpHeaderCollection headerCollection = new HttpHeaderCollection();

            headerCollection.Add(httpHeader);

            Assert.Throws <BadRequestException>(() => headerCollection.GetHeader(string.Empty));
        }