public void GetServer()
        {
            ServersWithAuthorizationCode.CleanUpForTests();
            var server1 = ServersWithAuthorizationCode.Add("myfunnyid",
                                                           "myfunnysecret",
                                                           new Uri("http://example.com/AuthorizationRequest"),
                                                           new Uri("http://example.com/AccessRequest"),
                                                           new Uri("http://example.com/RedirectionUri"));
            var server2 = ServersWithAuthorizationCode.Add("myfunnyid2",
                                                           "myfunnysecret",
                                                           new Uri("http://example.com/AuthorizationRequest2"),
                                                           new Uri("http://example.com/AccessRequest2"),
                                                           new Uri("http://example.com/RedirectionUri2"));

            server2.Version = Server.OAuthVersion.v2_22;


            var server1Result = ServersWithAuthorizationCode.GetServerWithAuthorizationCode(server1.Guid);

            Assert.AreEqual(server1, server1Result);
            Assert.IsTrue(ServersWithAuthorizationCode.ServerWithAuthorizationCodeExists(server1.Guid));

            var server2Result = ServersWithAuthorizationCode.GetServerWithAuthorizationCode(server2.ClientId, server2.AuthorizationRequestUri, server2.AccessTokenRequestUri, server2.RedirectionUri);

            Assert.AreEqual(server2, server2Result);
            Assert.IsTrue(ServersWithAuthorizationCode.ServerWithAuthorizationCodeExists(server2.ClientId, server2.AuthorizationRequestUri, server2.AccessTokenRequestUri, server2.RedirectionUri));

            var resourceOwnerNull = ServersWithAuthorizationCode.GetServerWithAuthorizationCode(Guid.NewGuid());

            Assert.IsNull(resourceOwnerNull);
            Assert.IsFalse(ServersWithAuthorizationCode.ServerWithAuthorizationCodeExists(Guid.NewGuid()));
        }
        public void SetUp()
        {
            _resourceOwnerName = "stoeren";
            if (!ResourceOwners.ResourceOwnerExists(_resourceOwnerName))
            {
                ResourceOwners.Add(_resourceOwnerName);
            }

            _clientId                = "268852326492238";
            _clientSharedSecret      = "124564561125648";
            _authorizationRequestUri = new Uri("http://example.com/AuthorizationRequest");
            _accessTokenRequestUri   = new Uri("http://example.com/access");
            _redirectionUri          = new Uri("http://example.com/RedirectionUri");
            if (!ServersWithAuthorizationCode.ServerWithAuthorizationCodeExists(_clientId, _authorizationRequestUri, _accessTokenRequestUri, _redirectionUri))
            {
                ServersWithAuthorizationCode.Add(_clientId, _clientSharedSecret, _authorizationRequestUri, _accessTokenRequestUri, _redirectionUri);
            }
        }