public void NoHeadersAdded()
        {
            WebHeaderCollection      headers = new WebHeaderCollection();
            HttpAuthenticationHeader authenticationHeader = new HttpAuthenticationHeader(headers);

            Assert.AreEqual(String.Empty, authenticationHeader.AuthenticationType);
        }
        public void NonStandardAuthenticationHeaderAdded()
        {
            WebHeaderCollection headers = new WebHeaderCollection();

            headers.Add(HttpResponseHeader.WwwAuthenticate, "Foo");
            HttpAuthenticationHeader authenticationHeader = new HttpAuthenticationHeader(headers);

            Assert.AreEqual("Foo", authenticationHeader.AuthenticationType);
        }
        public void IsBasicAuthentication()
        {
            WebHeaderCollection headers = new WebHeaderCollection();

            headers.Add(HttpResponseHeader.WwwAuthenticate, "Basic realm='localhost'");
            HttpAuthenticationHeader authenticationHeader = new HttpAuthenticationHeader(headers);

            Assert.AreEqual("Basic", authenticationHeader.AuthenticationType);
        }
        public void DigestAuthenticationSchemeAdded()
        {
            WebHeaderCollection headers = new WebHeaderCollection();

            headers.Add(HttpResponseHeader.WwwAuthenticate, "Digest realm='test'");
            headers.Add(HttpResponseHeader.WwwAuthenticate, "NTLM");
            HttpAuthenticationHeader authenticationHeader = new HttpAuthenticationHeader(headers);

            Assert.AreEqual("Digest,NTLM", authenticationHeader.AuthenticationType);
        }
        public void IsWindowsAuthentication()
        {
            WebHeaderCollection headers = new WebHeaderCollection();

            headers.Add(HttpResponseHeader.WwwAuthenticate, "Negotiate");
            headers.Add(HttpResponseHeader.WwwAuthenticate, "NTLM");
            HttpAuthenticationHeader authenticationHeader = new HttpAuthenticationHeader(headers);

            Assert.AreEqual("Negotiate,NTLM", authenticationHeader.AuthenticationType);
        }
        public void ManyAuthenticationSchemesAdded()
        {
            WebHeaderCollection headers = new WebHeaderCollection();

            headers.Add(HttpResponseHeader.WwwAuthenticate, "Negotiate");
            headers.Add(HttpResponseHeader.WwwAuthenticate, "NTLM");
            headers.Add(HttpResponseHeader.WwwAuthenticate, "Basic realm='test'");
            HttpAuthenticationHeader authenticationHeader = new HttpAuthenticationHeader(headers);

            Assert.AreEqual("Negotiate,NTLM,Basic", authenticationHeader.AuthenticationType);
        }