Пример #1
0
        public void ContainsHeaderWithoutKeyShouldThrowException()
        {
            HttpHeader httpHeader = new HttpHeader("name", "pesho");

            HttpHeaderCollection headerCollection = new HttpHeaderCollection();

            headerCollection.Add(httpHeader);

            Assert.Throws <BadRequestException>(() => headerCollection.ContainsHeader(string.Empty));
        }
Пример #2
0
        public void GetContainedHeaderShouldReturnTrue()
        {
            HttpHeader httpHeader = new HttpHeader("name", "pesho");

            HttpHeaderCollection headerCollection = new HttpHeaderCollection();

            headerCollection.Add(httpHeader);

            Assert.True(headerCollection.ContainsHeader(httpHeader.Key));
        }
Пример #3
0
        public void GetNotContainedHeaderShouldReturnFalse()
        {
            HttpHeaderCollection headerCollection = new HttpHeaderCollection();

            Assert.False(headerCollection.ContainsHeader("name"));
        }