コード例 #1
0
 public void TestGetUserAsyncWithOAuth()
 {
     Completion = new ManualResetEvent(false);
     SoundCloudApiAuthenticated.User().GetAsync(UserBuilder);
     Completion.WaitOne(TimeSpan.FromSeconds(100));
     Assert.IsNotEmpty(_asyncUserResult.Username);
 }
コード例 #2
0
        public void TestCreateUserWebProfileRequest()
        {
            var webProfileWithId = SoundCloudApiAuthenticated.User(509497).WebProfile().Post(_webProfile);
            var newWebProfile    = SoundCloudApiAuthenticated.User(509497).WebProfile(webProfileWithId.Id).Get();

            Assert.AreEqual(webProfileWithId.Id, newWebProfile.Id);
            SoundCloudApiAuthenticated.User().WebProfile(webProfileWithId.Id).Delete();
        }
コード例 #3
0
        public void TestPutUserWebProfileRequest()
        {
            var webProfileWithId = SoundCloudApiAuthenticated.User(509497).WebProfile().Post(_webProfile);

            webProfileWithId.Title = "Owl 2";
            SoundCloudApiAuthenticated.User().WebProfile(webProfileWithId.Id).Put(webProfileWithId);
            var scVersion = SoundCloudApiAuthenticated.User().WebProfile(webProfileWithId.Id).Get();

            Assert.AreEqual(webProfileWithId.Title, scVersion.Title);
            SoundCloudApiAuthenticated.User().WebProfile(webProfileWithId.Id).Delete();
        }
コード例 #4
0
        public void TestGetUserMultipleRequestsWithOAuth()
        {
            var resourceList = new List <IUser>
            {
                SoundCloudApiAuthenticated.User(),
                SoundCloudApiAuthenticated.User(),
                SoundCloudApiAuthenticated.User(),
            };
            var users = SoundCloudApiAuthenticated.Execute(resourceList);

            Assert.AreEqual(3, users.Count);
        }
コード例 #5
0
        public void TestGetUserAsyncMultipleRequestsWithOAuth()
        {
            Completion = new ManualResetEvent(false);

            var resourceList = new List <IUser>
            {
                SoundCloudApiAuthenticated.User(),
                SoundCloudApiAuthenticated.User(),
                SoundCloudApiAuthenticated.User(),
            };

            SoundCloudApiAuthenticated.ExecuteAsync(resourceList, UserListBuilder);
            Assert.AreEqual(3, _asyncUsersResult.Count);
        }
コード例 #6
0
        public void TestGetUserWithOAuthRequestForceRefresh()
        {
            SoundCloudApiAuthenticated.User().Get();

            var token = PasswordCredentialsState.Load();

            token.ExpiresIn = 1;
            // Override the usual hour long session soundcloud sends back

            while (!token.HasExpired())
            {
                Thread.Sleep(100);
            }
            PasswordCredentialsState.Save(token);

            SoundCloudApiAuthenticated = SoundCloudApi.CreateClient(TestSettings.ClientId, TestSettings.ClientSecret, PasswordCredentialsState);
            var user = SoundCloudApiAuthenticated.User().Get();

            Assert.IsNotEmpty(user.Username);
        }
コード例 #7
0
        public void TestGetUserWithOAuthRequest()
        {
            var user = SoundCloudApiAuthenticated.User().Get();

            Assert.AreEqual(509497, user.Id);
        }
コード例 #8
0
        public void TestDeleteUserWebProfileRequest()
        {
            var webProfileWithId = SoundCloudApiAuthenticated.User(509497).WebProfile().Post(_webProfile);

            SoundCloudApiAuthenticated.User().WebProfile(webProfileWithId.Id).Delete();
        }
コード例 #9
0
        public void TestGetUserWebProfileRequest()
        {
            var webprofile = SoundCloudApiAuthenticated.User().WebProfiles().Get();

            Assert.IsNotNull(webprofile);
        }
コード例 #10
0
        public void TestPutUserFollowingRequest()
        {
            var user = SoundCloudApiAuthenticated.User().Following(17567595).Put();

            Assert.IsNotNull(user.Username);
        }
コード例 #11
0
 public void UserFollowingResourceTestsTearDown()
 {
     SoundCloudApiAuthenticated.User().Following(17567595).Delete();
 }
コード例 #12
0
 public void TestDeleteUserFollowingRequest()
 {
     SoundCloudApiAuthenticated.User().Following(17567595).Delete();
 }
コード例 #13
0
 public void TestPutUserFavoriteRequest()
 {
     SoundCloudApiAuthenticated.User().Favorite(1379060).Put();
 }
コード例 #14
0
 public void UserFavoriteResourceTestsTearDown()
 {
     SoundCloudApiAuthenticated.User().Favorite(1379060).Delete();
 }