Example #1
0
            public void Must_parse_correctly(string headerValue)
            {
                AcceptEncodingHeader[] headers = AcceptEncodingHeader.ParseMany(headerValue).ToArray();

                Assert.That(headers, Has.Length.EqualTo(4));

                Assert.That(headers[0].ContentCoding, Is.EqualTo("compress"));
                Assert.That(headers[0].Qvalue, Is.EqualTo(1m));
                Assert.That(headers[0].EffectiveQvalue, Is.EqualTo(1m));

                Assert.That(headers[1].ContentCoding, Is.EqualTo("gzip"));
                Assert.That(headers[1].Qvalue, Is.EqualTo(0m));
                Assert.That(headers[1].EffectiveQvalue, Is.EqualTo(0m));

                Assert.That(headers[2].ContentCoding, Is.EqualTo("identity"));
                Assert.That(headers[2].Qvalue, Is.EqualTo(0.567m));
                Assert.That(headers[2].EffectiveQvalue, Is.EqualTo(0.567m));

                Assert.That(headers[3].ContentCoding, Is.EqualTo("*"));
                Assert.That(headers[3].Qvalue, Is.Null);
                Assert.That(headers[3].EffectiveQvalue, Is.EqualTo(1m));
            }
Example #2
0
 public void Must_not_result_in_header(string headerValue)
 {
     Assert.That(AcceptEncodingHeader.ParseMany(headerValue), Is.Empty);
 }
Example #3
0
            public void Must_not_match(string headerValue, string contentCoding)
            {
                AcceptEncodingHeader header = AcceptEncodingHeader.ParseMany(headerValue).Single();

                Assert.That(header.ContentCodingMatches(contentCoding), Is.False);
            }