public void Test_OAuth2_RefreshToken()
        {
            var client = SoundCloudClient.Create();

            var loginCredentials = new Credentials();

            loginCredentials.client_id     = _settings.ClientId;
            loginCredentials.client_secret = _settings.ClientSecret;
            loginCredentials.username      = _settings.Username;
            loginCredentials.password      = _settings.Password;

            var loginResult = client.OAuth2.Login(loginCredentials);

            Assert.That(loginResult.IsSuccess, Is.True);

            var credentials = new Credentials();

            credentials.client_id     = _settings.ClientId;
            credentials.client_secret = _settings.ClientSecret;
            credentials.refresh_token = loginResult.Data.refresh_token;

            var refreshResult = client.OAuth2.RefreshToken(credentials);

            Assert.That(refreshResult.IsSuccess, Is.True);
            Assert.That(string.IsNullOrEmpty(refreshResult.Data.access_token), Is.False);
            Assert.That(string.IsNullOrEmpty(refreshResult.Data.refresh_token), Is.False);
            Assert.That(refreshResult.Data.expires_in, Is.Not.Null);
        }
        public void Test_Me()
        {
            var client = SoundCloudClient.Create();

            var me = client.Me;

            Assert.That(me, Is.Not.Null);
        }
        public void Test_Groups()
        {
            var client = SoundCloudClient.Create();

            var groups = client.Groups;

            Assert.That(groups, Is.Not.Null);
        }
        public void Test_IsAuthorized()
        {
            var client = SoundCloudClient.Create();

            client.Token = Token;

            Assert.That(client.IsAuthorized, Is.True);
        }
        public void Test_ClientId()
        {
            var client = SoundCloudClient.Create();

            client.ClientId = ClientId;

            Assert.That(client.ClientId, Is.EqualTo(ClientId));
        }
        public void Test_Comments()
        {
            var client = SoundCloudClient.Create();

            var comments = client.Comments;

            Assert.That(comments, Is.Not.Null);
        }
        public void Test_Track()
        {
            var client = SoundCloudClient.Create();

            var tracks = client.Tracks;

            Assert.That(tracks, Is.Not.Null);
        }
        public void Test_User()
        {
            var client = SoundCloudClient.Create();

            var user = client.Users;

            Assert.That(user, Is.Not.Null);
        }
        public void Test_Apps()
        {
            var client = SoundCloudClient.Create();

            var apps = client.Apps;

            Assert.That(apps, Is.Not.Null);
        }
        public void Test_Token()
        {
            var client = SoundCloudClient.Create();

            client.Token = Token;

            Assert.That(client.Token, Is.EqualTo(Token));
        }
        public void Test_Resolve()
        {
            var client = SoundCloudClient.Create();

            var resolve = client.Resolve;

            Assert.That(resolve, Is.Not.Null);
        }
        public void Test_Playlist()
        {
            var client = SoundCloudClient.Create();

            var playlists = client.Playlists;

            Assert.That(playlists, Is.Not.Null);
        }
        public void Test_OAuth()
        {
            var client = SoundCloudClient.Create();

            var oAuth2 = client.OAuth2;

            Assert.That(oAuth2, Is.Not.Null);
        }
        public void Test_OAuth2_ClientCredentials()
        {
            var credentials = new Credentials();

            credentials.client_id     = _settings.ClientId;
            credentials.client_secret = _settings.ClientSecret;

            var client            = SoundCloudClient.Create();
            var postedCredentials = client.OAuth2.ClientCredentials(credentials);

            Assert.That(postedCredentials.IsSuccess, Is.True);
            Assert.That(string.IsNullOrEmpty(postedCredentials.Data.access_token), Is.False);
            Assert.That(string.IsNullOrEmpty(postedCredentials.Data.refresh_token), Is.False);
            Assert.That(postedCredentials.Data.expires_in, Is.Not.Null);
        }
        public void Test_EnsureToken()
        {
            var client = SoundCloudClient.Create();

            Assert.Throws <SoundCloudInsufficientAccessRightsException>(() => client.Tracks.Update(new Track()));
        }
        public void Test_EnsureClientId()
        {
            var client = SoundCloudClient.Create();

            Assert.Throws <SoundCloudInsufficientAccessRightsException>(() => client.Tracks.Get());
        }