Example #1
0
            public void Must_parse_correctly(string headerValue, string username, string realm, string nonce, string digestUri, string response, string algorithm, string cnonce, string opaque, string messageQop, string nonceCount)
            {
                DigestProxyAuthorizationHeader header = DigestProxyAuthorizationHeader.Parse(headerValue);

                Assert.That(header, Is.Not.Null);
                Assert.That(header.AuthScheme, Is.StringMatching("[Dd]igest"));
                Assert.That(header.Username, Is.EqualTo(username));
                Assert.That(header.Realm, Is.EqualTo(realm));
                Assert.That(header.Nonce, Is.EqualTo(nonce));
                Assert.That(header.DigestUri, Is.EqualTo(new Uri(digestUri, UriKind.RelativeOrAbsolute)));
                Assert.That(header.Response, Is.EqualTo(response));
                Assert.That(header.Algorithm, Is.EqualTo(algorithm));
                Assert.That(header.Cnonce, Is.EqualTo(cnonce));
                Assert.That(header.Opaque, Is.EqualTo(opaque));
                Assert.That(header.MessageQop, Is.EqualTo(messageQop));
                Assert.That(header.NonceCount, Is.EqualTo(nonceCount));
            }
Example #2
0
 public void Must_not_result_in_header(string headerValue)
 {
     Assert.That(DigestProxyAuthorizationHeader.Parse(headerValue), Is.Null);
 }