Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public void TryGetInvalidHeaderShouldReturnNull()
        {
            HttpHeader httpHeader = new HttpHeader("name", "pesho");

            HttpHeaderCollection headerCollection = new HttpHeaderCollection();

            headerCollection.Add(httpHeader);

            Assert.Null(headerCollection.GetHeader("age"));
        }
Exemplo n.º 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));
        }