public void MissingAuth_Fails()
        {
            var request = HttpTestUtils.CreateHttpListenerRequest();
            var auth    = new TestRpcServerBasicAuth();
            var result  = auth.Authenticate(request);

            Assert.IsNull(result.ClientID);
            Assert.IsFalse(result.Success);
        }
        public void CorrectAuth_Succeeds()
        {
            var request = HttpTestUtils.CreateHttpListenerRequest(client =>
                                                                  client.DefaultRequestHeaders.Add("Authorization", "Basic b3R0bzpPVFRP")); // otto:OTTO
            var auth   = new TestRpcServerBasicAuth();
            var result = auth.Authenticate(request);

            Assert.AreEqual("otto", result.ClientID);
            Assert.IsTrue(result.Success);
        }
        public void WrongAuth_Fails()
        {
            var request = HttpTestUtils.CreateHttpListenerRequest(client =>
                                                                  client.DefaultRequestHeaders.Add("Authorization", "Basic b3R0bzpoYW5z")); // otto:hans
            var auth   = new TestRpcServerBasicAuth();
            var result = auth.Authenticate(request);

            Assert.AreEqual("otto", result.ClientID);
            Assert.IsFalse(result.Success);
        }