コード例 #1
0
        public void TestGetUserMultipleRequests()
        {
            var resourceList = new List <IUser>
            {
                SoundCloudApiUnAuthenticated.User(509497),
                SoundCloudApiUnAuthenticated.User(509497),
                SoundCloudApiUnAuthenticated.User(509497),
            };
            var users = SoundCloudApiUnAuthenticated.Execute(resourceList);

            Assert.AreEqual(3, users.Count);
        }
コード例 #2
0
        public void TestAllPropertiesGetUserRequest()
        {
            var user         = SoundCloudApiUnAuthenticated.User(509497).Get();
            var expectedUser = new User {
                Id                   = 509497,
                Permalink            = "owlandrews",
                Username             = "******",
                Uri                  = "https://api.soundcloud.com/users/509497",
                PermalinkUrl         = "https://soundcloud.com/owlandrews",
                AvatarUrl            = "https://i1.sndcdn.com/avatars-000071198254-gx9y0q-large.jpg",
                Country              = null,
                FullName             = "Owl Andrews",
                Description          = "Bristol based producer; releases on Car Crash Set and a resident for Bristol Bass. \r\n\r\nContact [email protected] for bookings.",
                City                 = "Bristol",
                DiscogsName          = null,
                Online               = true,
                TrackCount           = 1,
                PlaylistCount        = 0,
                Plan                 = "Free",
                PublicFavoritesCount = 1,
                FollowersCount       = 1,
                FollowingsCount      = 1,
            };

            Assert.AreEqual(expectedUser.AvatarUrl, user.AvatarUrl.Substring(0, user.AvatarUrl.IndexOf(".jpg", StringComparison.Ordinal) + 4));
            Assert.AreEqual(expectedUser.City, user.City);
            Assert.AreEqual(expectedUser.Country, user.Country);
            Assert.AreEqual(expectedUser.Description, user.Description);
            Assert.AreEqual(expectedUser.DiscogsName, user.DiscogsName);
            Assert.GreaterOrEqual(user.FollowersCount, expectedUser.FollowersCount);
            Assert.GreaterOrEqual(user.FollowingsCount, expectedUser.FollowingsCount);
            Assert.AreEqual(user.FullName, expectedUser.FullName);
            Assert.AreEqual(expectedUser.Id, user.Id);
            Assert.AreEqual(expectedUser.MyspaceName, user.MyspaceName);
            Assert.AreEqual(expectedUser.Permalink, user.Permalink);
            Assert.AreEqual(expectedUser.Plan, user.Plan);
            Assert.AreEqual(expectedUser.PlaylistCount, user.PlaylistCount);
            Assert.GreaterOrEqual(user.PublicFavoritesCount, expectedUser.PublicFavoritesCount);
            Assert.GreaterOrEqual(user.TrackCount, expectedUser.TrackCount);
            Assert.AreEqual(user.Username, expectedUser.Username);
            Assert.True(new UserComparer().Equals(expectedUser, user));
        }
コード例 #3
0
        public void TestGetUserRequest()
        {
            var user = SoundCloudApiUnAuthenticated.User(509497).Get();

            Assert.AreEqual(509497, user.Id);
        }